简体   繁体   中英

Print twig variable inside function

How do I output the variable target_id instead of node.nid? inside the function call?

{% set target_id = content.field_internal_lnk %} <a href="{{ path('entity.node.canonical', {'node': node.nid }) }}">{{ content.field_button_text }}</a>

通过使用正确的变量名?

{'node': target_id }

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM