What happened?
Description
Entries belonging to entry types that have been given CP icons inherit those icons on the front end. Maybe this is intended in Craft 5, but it's quite confusing.
Steps to reproduce
- Create a new section with a new entry type and give it a custom CP icon
- Create an entry in that section
{{ entry.icon }} will return the string value of the entry type's CP icon on the front end
Expected behavior
I would expect one or more of the following:
- The field to not exist if it has not been created, so I can apply an appropriate and expected conditional for non-existence
- The icon to exist, but on the type, such as
{{ entry.type.icon }}
Actual behavior
- If your entry type does not have a custom
icon field created for it, it will still return a string value for {{ entry.icon }} from the entry type's meta icon value.
Craft CMS version
5.4.9
PHP version
8.3
Operating system and version
Mac OS Sonoma 14.6.1
Database type and version
MySQL 8.0.36
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions
What happened?
Description
Entries belonging to entry types that have been given CP icons inherit those icons on the front end. Maybe this is intended in Craft 5, but it's quite confusing.
Steps to reproduce
{{ entry.icon }}will return the string value of the entry type's CP icon on the front endExpected behavior
I would expect one or more of the following:
{{ entry.type.icon }}Actual behavior
iconfield created for it, it will still return a string value for{{ entry.icon }}from the entry type's meta icon value.Craft CMS version
5.4.9
PHP version
8.3
Operating system and version
Mac OS Sonoma 14.6.1
Database type and version
MySQL 8.0.36
Image driver and version
Imagick 3.7.0 (ImageMagick 6.9.11-60)
Installed plugins and versions