Custom icons¶
Customize Content Type icons¶
To add custom icons for existing Content Types or custom Content Types in Ibexa DXP, follow the instructions below.
To configure a custom icon for a Content Type, use the following configuration in config/packages/ezplatform.yaml, for example:
1 2 3 4 5 6 | |
Place the icon in public/assets/images and run yarn encore <dev|prod> after adding it.
Icons format
All icons should be in SVG format with symbol so they can display properly in the Back Office.
Access icons in Twig templates¶
Content Type icons are accessible in Twig templates via the ez_content_type_icon function.
It requires Content Type identifier as an argument. The function returns the path to a Content Type icon.
1 2 3 | |
Access icons in JavaScript¶
Content Types icons configuration is stored in a global object: eZ.adminUiConfig.contentTypes.
You can easily retrieve the icon URL with the getContentTypeIcon helper function that is set on the global eZ.helpers.contentType object.
It takes Content Type identifier as an argument and returns one of the following items:
- URL of a specified Content Type's icon
nullif there is no Content Type with specified identifier
Example with getContentTypeIcon:
1 2 3 4 5 6 | |
Icon sets¶
You can configure icon sets to be used per SiteAccess:
1 2 3 4 5 6 7 8 | |