Use Display Suite token field in custom block type template
-
16-02-2021 - |
题
- I have a custom block type, which uses its own theme template.
- I have a display suite token field
link_card_edit_block
- It just uses HTML and tokens to create a link.
I want to use that field in my block type template.
Without the custom template, the field shows up.
- If I add
{{ content }}
in the custom block template, the field shows. - But I can't figure out how show that field individually.
Here is what I have tried:
{{ content['#block_content'].field_link_card_edit_block.value }}
{{ content['#block_content'].field_link_card_edit_block[0] }}
{{ content['#block_content'].field_link_card_edit_block }}
{{ content.field_link_card_edit_block.value }}
{{ content.field_link_card_edit_block[0] }}
{{ content.field_link_card_edit_block }}
All of them produce nothing.
解决方案
My teammate figured this out:
{{ content['dynamic_token_field:block_content-link_card_edit_block'] }}
不隶属于 drupal.stackexchange