Last active
March 29, 2017 20:55
-
-
Save backlineint/9687354d0ba6a09ac645e8dbe87add2d to your computer and use it in GitHub Desktop.
More Involved Use of field_target_entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# Force caching for entities we’re not rendering #} | |
{% set catch_cache = content.field_season|render %} | |
{% set season = content.field_season|field_target_entity %} | |
{# Can now access fields on the referenced practice entity like… #} | |
{% include "@molecules/card/card.twig" | |
with { | |
"img_src": file_url(content.field_image|field_target_entity.uri.value), | |
"img_alt": content.field_image|field_raw('alt'), | |
"header": label|field_value, | |
"season": season.name.value, | |
"city": season.field_city.value, | |
"copy": content.body|field_value | |
} | |
%} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment