like-and-dislike-icons.html.twig in Like & Dislike 8
The template file to display icons for the like and dislike links.
Available variables:
- entity_id: The id of the entity for which is the vote is done.
- entity_type: The entity type id of the entity for which the vote is done.
- icons: An associative array of icons keyed by type. Each icon contains
the following properties:
- label: The label for the vote type.
- count: The number of votes.
- attributes: HTML attributes for the vote link.
1 theme call to like-and-dislike-icons.html.twig
- LikeDislikeVoteBuilder::build in src/
LikeDislikeVoteBuilder.php - Lazy builder callback for displaying like and dislike icons.
File
templates/like-and-dislike-icons.html.twigView source
- {#
- /**
- * @file
- * The template file to display icons for the like and dislike links.
- *
- * Available variables:
- * - entity_id: The id of the entity for which is the vote is done.
- * - entity_type: The entity type id of the entity for which the vote is
- * done.
- * - icons: An associative array of icons keyed by type. Each icon contains
- * the following properties:
- * - label: The label for the vote type.
- * - count: The number of votes.
- * - attributes: HTML attributes for the vote link.
- */
- #}
- <div class="vote-widget-wrapper">
- <div class="vote-widget vote-widget--like-and-dislike">
- {% for type, icon in icons %}
- <div class="vote-{{ type }} type-{{ entity_type }}" id="{{ type }}-container-{{ entity_type }}-{{ entity_id }}">
- <a {{ icon.attributes }}>{{ icon.label }}</a>
- <span class="count">{{ icon.count }}</span>
- </div>
- {% endfor %}
- </div>
- </div>