Improvement of the CERN Agenda box component

The Agenda Box component as a field for the “event category” (like ‘Event’ or ‘Webcast’). However the template seems to be overly restrictive:

        {# Content Type field #}
				{# Initializes content_type with word "Event"#}
				{% set ct = 'Event' %}
				{% if content_type | render | striptags | trim == "Webcast Event" %}
						{% set ct = 'Webcast' %}
				{% endif %}
				<div class="agenda-box-content-type">
						{{ ct|t }}

I am using it for my own content type and I would like to output the value of the field which is mapped.

I believe this template should be modified to do a kind of “if/elseif” for the values “you” care about, and default to outputing the plain value of the field.

What do you think ?

Alternatively, could you tell me how I could override that template in my theme (cernoverride), if at all possible?

Hi Cedric,

You can put the CERN Components module locally in your website and make the change in its twig file under patterns/molecules/agenda-box

The problem is that you won’t be able to get the latest updates of the CERN Components module anymore and you will be responsible to update it manually every time there is a new version and re-apply your patch to agenda-box.


I also managed to find the template name and override it without having the module locally:


Yes that’s the best solution :slight_smile: