{% set entity = entity|default(ea.entity) %} {% set publication_fields = {'App\\Entity\\Offre': ['offre', 'published'], 'App\\Entity\\Projet': ['projet', 'online'], 'App\\Entity\\Ressource': ['ressource', 'published'], 'App\\Entity\\Tag': ['tag', 'active'], 'App\\Entity\\Pole': ['pole', 'online'], 'App\\Entity\\Page': ['page', 'online'], 'App\\Entity\\Reseau': ['reseau', 'online']} %} {% set config = publication_fields[entity.fqcn] %} {% set published = attribute(entity.instance, config[1]) %}