stacks-8.x-1.x-dev/modules/stacks_examples/stacks/widget-content-feed/article-content/templates/article-content--default.html.twig

modules/stacks_examples/stacks/widget-content-feed/article-content/templates/article-content--default.html.twig
{#
.ajax_wrapper and .ajax_results classes are important, as they are used to
target in the ajax calls and css.

{{ ajax_attributes }} prints some necessary attributes we need for the JS. This
needs to be attached to .ajax_results.
#}

{# {{ output() }} #}

{% if fields.field_title  %}
  <h2>{{ fields.field_title }}</h2>
{% endif %}

<div class="ajax_wrapper">
  {# We need this wrapper div to handle the ajax loader html properly. #}

  {# Filters #}
  {% if grid.filters %}
    <div>

      {% if grid.filters.content_types %}
        <select name="content_types" class="ajax_filter">
          <option value="">All Content Types</option>
          {% for filter_key,filter_value in grid.filters.content_types %}
            <option value="{{ filter_key }}">{{ filter_value }}</option>
          {% endfor %}
        </select>
      {% endif %}

      {% if grid.filters.taxonomy_terms %}
        {% for vocab_key,vocab_terms in grid.filters.taxonomy_terms %}
          <select name="{{ vocab_key }}" field="{{ vocab_key }}" class="ajax_filter" filtertype="taxonomy">
            <option value="">All {{ grid.filters.taxonomy_vocab_names[vocab_key] }}</option>
            {% for filter_key,filter_value in vocab_terms %}
              <option value="{{ filter_key }}">{{ filter_value }}</option>
            {% endfor %}
          </select>
        {% endfor %}
      {% endif %}

      {% if grid.filters.sort %}
        <select name="sort" class="ajax_filter">
          {% for filter_key,filter_value in grid.filters.sort %}
            <option value="{{ filter_key }}"{% if filter_key == grid.default_sort %} selected{% endif %}>{{ filter_value }}</option>
          {% endfor %}
        </select>
      {% endif %}

      {% if grid.filters.search %}
        <form class="filter_search_form">
          <input type="text" name="search" class="ajax_filter" value="" placeholder="Search">
        </form>
      {% endif %}

    </div>
  {% endif %}

  <div class="ajax_results"{{ grid.ajax_attributes }}>
    {# Include the twig file that has the results. This div will get replaced with the ajax calls. #}
    {% include 'article-content/ajax/ajax_article-content--default.html.twig'|getStacksPath %}
  </div>
</div>

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc