announcements.html.twig

Same filename in other branches
  1. 11.x core/modules/announcements_feed/templates/announcements.html.twig
{% if count %}
  <nav class="announcements">
    <ul>
      {% if featured|length %}
        {% for announcement in featured %}
          <li class="announcement announcement--featured" data-drupal-featured>
            <div class="announcement__title">
              <h4>{{ announcement.title }}</h4>
            </div>
            <div class="announcement__teaser">
              {{ announcement.content }}
            </div>
            <div class="announcement__link">
              <a href="{{ announcement.url }}">{{ 'Learn More'|t }}</a>
            </div>
          </li>
        {% endfor %}
      {% endif %}
      {% for announcement in standard %}
        <li class="announcement announcement--standard">
          <div class="announcement__title">
            <a href="{{ announcement.url }}">{{ announcement.title }}</a>
            <div class="announcement__date">{{ announcement.datePublishedTimestamp|format_date('short') }}</div>
          </div>
        </li>
      {% endfor %}
    </ul>
  </nav>

  {% if feed_link %}
    <p class="announcements--view-all">
      <a target="_blank" href="{{ feed_link }}">{{ 'View all announcements'|t }}</a>
    </p>
  {% endif %}
{% else %}
  <div class="announcements announcements--empty"><p> {{ 'No announcements available'|t }}</p></div>
{% endif %}

File

core/modules/announcements_feed/templates/announcements.html.twig

View source
  1. {% if count %}
  2. <nav class="announcements">
  3. <ul>
  4. {% if featured|length %}
  5. {% for announcement in featured %}
  6. <li class="announcement announcement--featured" data-drupal-featured>
  7. <div class="announcement__title">
  8. <h4>{{ announcement.title }}</h4>
  9. </div>
  10. <div class="announcement__teaser">
  11. {{ announcement.content }}
  12. </div>
  13. <div class="announcement__link">
  14. <a href="{{ announcement.url }}">{{ 'Learn More'|t }}</a>
  15. </div>
  16. </li>
  17. {% endfor %}
  18. {% endif %}
  19. {% for announcement in standard %}
  20. <li class="announcement announcement--standard">
  21. <div class="announcement__title">
  22. <a href="{{ announcement.url }}">{{ announcement.title }}</a>
  23. <div class="announcement__date">{{ announcement.datePublishedTimestamp|format_date('short') }}</div>
  24. </div>
  25. </li>
  26. {% endfor %}
  27. </ul>
  28. </nav>
  29. {% if feed_link %}
  30. <p class="announcements--view-all">
  31. <a target="_blank" href="{{ feed_link }}">{{ 'View all announcements'|t }}</a>
  32. </p>
  33. {% endif %}
  34. {% else %}
  35. <div class="announcements announcements--empty"><p> {{ 'No announcements available'|t }}</p></div>
  36. {% endif %}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.