You are here

office-hours.html.twig in Office Hours 8

<div class="office-hours">
  {% for item in items %}
    <div class="office-hours__item">
      {% if item.label %}
        <span class="office-hours__item-label" style="width: {{ label_length * 0.60 }}em;">{{ item.label }}</span>
      {% endif %}
      {% if item.slots['#markup'] is not empty %}
        <span class="office-hours__item-slots">{{ item.slots }}</span>
      {% endif %}
      {% if item.comments['#markup'] is not empty %}
        <span class="office-hours__item-comments">{{ item.comments }}</span>
      {% endif %}
      <span>{{ item_separator | raw }}</span>
    </div>
  {% endfor %}
  {% if schema %}
    {% for meta in schema %}
      <meta property="openingHours" content="{{ meta.label }}{{ meta.slots }}">
    {% endfor %}
  {% endif %}
</div>

File

templates/office-hours.html.twig
View source
  1. <div class="office-hours">
  2. {% for item in items %}
  3. <div class="office-hours__item">
  4. {% if item.label %}
  5. <span class="office-hours__item-label" style="width: {{ label_length * 0.60 }}em;">{{ item.label }}</span>
  6. {% endif %}
  7. {% if item.slots['#markup'] is not empty %}
  8. <span class="office-hours__item-slots">{{ item.slots }}</span>
  9. {% endif %}
  10. {% if item.comments['#markup'] is not empty %}
  11. <span class="office-hours__item-comments">{{ item.comments }}</span>
  12. {% endif %}
  13. <span>{{ item_separator | raw }}</span>
  14. </div>
  15. {% endfor %}
  16. {% if schema %}
  17. {% for meta in schema %}
  18. <meta property="openingHours" content="{{ meta.label }}{{ meta.slots }}">
  19. {% endfor %}
  20. {% endif %}
  21. </div>