claro-8.x-1.x-dev/templates/filter/filter-tips.html.twig
templates/filter/filter-tips.html.twig
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | {# /** * @file * Theme override for a set of filter tips. * * Available variables: * - tips: Descriptions and a CSS ID in the form of 'module-name/filter-id' * (only used when 'long' is TRUE) for each filter in one or more text * formats. * - long: A flag indicating whether the passed-in filter tips contain extended * explanations, i.e. intended to be output on the path 'filter/tips' * (TRUE), or are in a short format, i.e. suitable to be displayed below a * form element. Defaults to FALSE. * - multiple: A flag indicating there is more than one filter tip. * * @see template_preprocess_filter_tips() * @see claro_preprocess_filter_tips() */ #} {% if multiple %} <h2>{{ 'Text Formats' |t }}</h2> {% endif %} {% if tips|length %} {% if multiple %} <div class = "compose-tips" > {% endif %} {% for name, tip in tips %} {% if multiple %} {% set tip_classes = [ 'compose-tips__item' , 'compose-tips__item--name-' ~ name|clean_class, ] %} <div{{ tip.attributes.addClass(tip_classes) }}> {% endif %} {% if multiple or long %} <h3>{{ tip.name }}</h3> {% endif %} {% if tip.list|length %} <ul class = "filter-tips {{ long ? 'filter-tips--long' : 'filter-tips--short'}}" > {% for item in tip.list %} {% set item_classes = [ 'filter-tips__item' , long ? 'filter-tips__item--long' : 'filter-tips__item--short' , long ? 'filter-tips__item--id-' ~ item.id|clean_class, ] %} <li{{ item.attributes.addClass(item_classes) }}>{{ item.tip }}</li> {% endfor %} </ul> {% endif %} {% if multiple %} </div> {% endif %} {% endfor %} {% if multiple %} </div> {% endif %} {% endif %} |