Skip to content

Commit

Permalink
Drupal 8 Theming - Part 13 - Kint, Arrays, Twig, Foreach, If
Browse files Browse the repository at this point in the history
  • Loading branch information
ivandoric committed Nov 29, 2015
1 parent c4b79f1 commit 94c6fb6
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions node--movies.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
<div class="movie-poster">
{{content.field_movie_poster}}
</div>
{{ kint(content.field_show_poster_['#items'].getValue())}}

{% for actor in content.field_actors['#items'].getValue() %}
{{actor.value}}<br>
{% endfor %}

{% if content.field_show_poster_['#items'].getValue()|first.value == "1" %}
<div class="movie-poster">
{{content.field_movie_poster}}
</div>
{% else %}
<h3>I don't want you to see Movie Poster</h3>
{% endif %}

<div class="director">
{{content.field_director}}
Expand Down

0 comments on commit 94c6fb6

Please sign in to comment.