Skip to content

Instantly share code, notes, and snippets.

@mariohernandez
Created February 3, 2019 02:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariohernandez/fa3a6a277b15f7d85d1ae6f5bbce2294 to your computer and use it in GitHub Desktop.
Save mariohernandez/fa3a6a277b15f7d85d1ae6f5bbce2294 to your computer and use it in GitHub Desktop.
Movie card twig template.
<article class="movie-card {{ modifier_class }}"
{{ attributes ? attributes.class }}"
{{ attributes ? attributes|without(class) }}>
{{ title_prefix }}
{{ title_suffix }}
{% if cover_image %}
<div class="movie-card__cover-image">
{{ cover_image }}
</div>
{% endif %}
<div class="movie-card__content">
{% if heading %}
{%
include '@nitflex_dev_theme/heading/heading.twig' with {
"heading": {
"title": heading.title,
"url": heading.url,
"heading_level": heading.heading_level,
"classes": 'movie-card__heading'
}
} only
%}
{% endif %}
<div class="movie-card__favorites-toggle">
{% block favorites_toggle %}
{%
include '@nitflex_dev_theme/add-to-favorites/add-to-favorites.twig' with {
url: '#',
} only
%}
{% endblock %}
</div>
{% if mpaa_rating %}
<div class="movie-card__mpaa-rating">
{% include '@nitflex_dev_theme/mpaa-rating/mpaa-rating.twig' with {
rating: mpaa_rating
} only
%}
</div>
{% endif %}
{% if average_rating %}
<div class="movie-card__average-rating">
{% include '@nitflex_dev_theme/average-rating/average-rating.twig' with {
count: average_rating
} only
%}
</div>
{% endif %}
{% if synopsis %}
<div class="movie-card__synopsis">
{{ synopsis }}
</div>
{% endif %}
</div>
</article>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment