eZ Platform Discussions

[Custom Tag] RichText template tag customtag is not configured


#1

I have configured 2 custom tags on my site.

system:
    default:
        fieldtypes:
            ezrichtext:
                custom_tags: [separator, advertising]

The “advertising” function. The separator displays the following message:

RichText template tag customtag is not configured

ezrichtext:
    custom_tags:
        separator:
            template: 'EdbPressePro3Bundle:fields/ezrichtext/custom_tags:separator.html.twig'
            icon: '/bundles/ezplatformadminui/img/ez-icons.svg#input-line'
            attributes:
                text:
                    type: 'string'
                    required: false
                    default_value: "separator"

        advertising:
            template: 'EdbPressePro3Bundle:fields/ezrichtext/custom_tags:advertising.html.twig'
            icon: '/bundles/ezplatformadminui/img/ez-icons.svg#blog'
            attributes:
                title:
                    type: 'string'
                    required: true
                    default_value: "advertising"
                zone_id:
                    type: 'number'
                    required: true
                mobile:
                    type: 'choice'
                    choices:
                      - "both"
                      - "mobile"
                      - "desktop"
                    default_value: 'both'
                    required: true
                promotional_skin:
                    type: 'choice'
                    choices:
                      - ""
                      - "promotional_skin"
                      - "hide"
                    default_value: ''

I don’t understand why one works and the other doesn’t…


#2

I can add some in the admin. It is then displayed as required. But once the content is published I get the error message. And if I change my Content the Custom Tag is not usable.


#3

Hello @remy_php.
Unfortunately I cannot reproduce this issue. For me both tags render properly.
The error you’ve pasted refers to a tag named customtag, yet what you have here is separator and advertising. It seems you have some leftover configuration that is affecting this setup.

Please also check if the configured template path is correct. If a template does not exist, it is not rendered at all and there’s an error log starting with Could not render template.

Kind Regards,
Andrew