- Issue created by @webmestre
- Status changed to Postponed: needs info
6 months ago 3:45pm 22 May 2024 - 🇪🇨Ecuador jwilson3
When building a node TWIG, I only can display the terme 'name'. No way to display the SVG icon.
I had to read this a few times to understand, and as far as I can tell, it appears your question might be confusing "node TWIG" for "Taxonomy TWIG"? since "term name" is for taxonomies and "node title" is for nodes.
Anyway, I've tested both adding a field_svg_icon to a Taxonomy vocabulary as well as a Node type, and the custom templates work the same way in both cases.
My template overrides:
{# taxonomy-term--tags.html.twig #} <a href="{{ url }}">{{ name }}</a> {{ dump(content) }} <h2>Custom rendered icon here:</h2> {{ content.field_svg_icon }} {{ content|without('field_svg_icon') }}
{{ dump(content) }} <h2>Custom rendered icon here:</h2> {{ content.field_svg_icon }} {{ content|without('comment')|without('field_svg_icon') }}
Both work fine:
My only suggestions are to ensure you've enabled the field_svg_icon in the correct display (eg Default, Full content, Teaser) on the "Manage Display" tab of your Content type and Taxonomy term config screens.
I'm afraid I'd need more clear example of your configuration to help troubleshoot this any further. Marking postponed.