listjs-8.x-1.x-dev/templates/listjs.html.twig

templates/listjs.html.twig
{#
/**
 * @file
 * Displays a list with listjs filter and sort buttons.
 *
 * Available variables:
 * - $placeholder_text: Placeholder text for the filter textfield.
 * - $items: An array of items to be rendered as list.
 *   - $item['data']: Renderable array.
 * - $attributes: HTML attributes for the element containing items.
 * - $list_id: Unique HTML id of the widget.
 * - $value_names: An associative array containing settings of every list
 *   attribute. Array is keyed by the attribute name.
 *   - $value_names['value-name-1']['sort']: TRUE if sort is allowed.
 *   - $value_names['value-name-1']['sort_text']: Text for the sort button.
 *
 * @see template_preprocess_listjs()
 *
 * @ingroup themeable
 */
#}
<div id="{{ list_id }}">
  <div class="filter-wrapper">
    <input class="search" placeholder="{{ placeholder_text }}" name="{{ list_id }}-filter" type="text">
  </div>

  <div class="sort-wrapper">
    {% for value_name, conf in value_names %}
      {% if conf.sort %}
        <input type="submit" class="sort" data-sort="{{ value_name }}" value="{{ conf.sort_text }}">
      {% endif %}
    {% endfor %}
  </div>

  <ul {{ attributes }}>
    {% for item in items %}
      <li>{{ item.data }}</li>
    {% endfor %}
  </ul>
</div>

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

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