Reference — URL
Fill in your field nameItalic values are placeholders: replace them with your own machine names, or let the builder do it.
Raw entity
Open in builder (Raw entity)Reads the entity directly, before field formatters run.
- Snippet 1
{{ path('entity. node. ',canonical {'node': node.field_name. target_id}) }} - Snippet 2
{{ path('entity. taxonomy_term. ',canonical {'taxonomy_term': node.field_name. target_id}) }}
Render array
Open in builder (Render array)Reads the content render array, after field formatters run.
- Twig
{{ content.field_name[0]['#url'] }}
Helper module
Open in builder (Helper module)Uses a contrib module’s Twig filter or function.
{{ path('entity. node. ',canonical {'node': content.field_name| field_target_entity. id}) }}
Contrib modules used
See helper modules for what each one provides.