You are here

views-view-flot.html.twig in Flot 8

{#
/**
 * Default theme implementation for Views to output a TARDIS archive.
 *
 * Available variables:
 * - options: View plugin style options:
 *   - classes: CSS classes.
 *   - nesting: Whether months should be nested inside years.
 *   - path: Link path. Eg.: example.com/TARDIS/2016/03
 *   - time_pool: Two-dimension array containing years and months with content.
 *
 * @see template_preprocess_views_view_tardis()
 *
 * @ingroup themeable
 */
#}
{%
  set classes = [
    'views-view-tardis',
    options.classes
  ]
%}
<div{{ attributes.addClass(classes) }}>
  <ul>
    {% for key, item in options.time_pool %}
      {% if options.nesting == 1 %}
        <li><a href="/{{ options.path }}/{{ key }}">{{ key }}</a><ul>
        {% for subkey, subitem in item %}
          <li><a href="/{{ options.path }}/{{ key }}/{{ subkey }}">{{ subitem }}</a></li>
        {% endfor %}
        </ul></li>
      {% else %}
        {% for subkey, subitem in item %}
          <li><a href="/{{ options.path }}/{{ key }}/{{ subkey }}">{{ subitem }}</a></li>
        {% endfor %}
      {% endif %}
    {% endfor %}
  </ul>
</div>

File

templates/views-view-flot.html.twig
View source
  1. {#
  2. /**
  3. * Default theme implementation for Views to output a TARDIS archive.
  4. *
  5. * Available variables:
  6. * - options: View plugin style options:
  7. * - classes: CSS classes.
  8. * - nesting: Whether months should be nested inside years.
  9. * - path: Link path. Eg.: example.com/TARDIS/2016/03
  10. * - time_pool: Two-dimension array containing years and months with content.
  11. *
  12. * @see template_preprocess_views_view_tardis()
  13. *
  14. * @ingroup themeable
  15. */
  16. #}
  17. {%
  18. set classes = [
  19. 'views-view-tardis',
  20. options.classes
  21. ]
  22. %}
  23. <div{{ attributes.addClass(classes) }}>
  24. <ul>
  25. {% for key, item in options.time_pool %}
  26. {% if options.nesting == 1 %}
  27. <li><a href="/{{ options.path }}/{{ key }}">{{ key }}</a><ul>
  28. {% for subkey, subitem in item %}
  29. <li><a href="/{{ options.path }}/{{ key }}/{{ subkey }}">{{ subitem }}</a></li>
  30. {% endfor %}
  31. </ul></li>
  32. {% else %}
  33. {% for subkey, subitem in item %}
  34. <li><a href="/{{ options.path }}/{{ key }}/{{ subkey }}">{{ subitem }}</a></li>
  35. {% endfor %}
  36. {% endif %}
  37. {% endfor %}
  38. </ul>
  39. </div>