You are here

onomasticon.html.twig in Onomasticon 2.x

Same filename and directory in other branches
  1. 8 templates/onomasticon.html.twig
{#

if ($cursor != 'default') {
  $cursor_class = ' onomasticon-cursor-' . $cursor;
}

#}

{{ attach_library('onomasticon/default') }}

{% set attributes = create_attribute() %}

{%
  set classes = [
    'onomasticon',
    implement == 'extra_element' ? 'onomasticon-extra-element',
    implement == 'extra_element' ? 'onomasticon-orientation-' ~ orientation,
    cursor == default ? '' : 'onomasticon-cursor-' ~ cursor,
  ]
%}

{% if implement == 'extra_element' %}
  <{{ tag }} {{ attributes.addClass(classes) }} tabindex="0" title="{{ needle }}">
    <button disabled="disabled" class="onomasticon-term-description">{{ description }}{% if termlink %}<p><a href="{{ termpath }}" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas" data-dialog-options="" title="{{ needle }}">read more</a></p>{% endif %}</button>
  </{{ tag }}>
{% else %}
  <{{ tag }} {{ attributes.addClass(classes) }} title="{{ description }}">{{ needle }}</{{ tag }}>
{% endif %}

File

templates/onomasticon.html.twig
View source
  1. {#
  2. if ($cursor != 'default') {
  3. $cursor_class = ' onomasticon-cursor-' . $cursor;
  4. }
  5. #}
  6. {{ attach_library('onomasticon/default') }}
  7. {% set attributes = create_attribute() %}
  8. {%
  9. set classes = [
  10. 'onomasticon',
  11. implement == 'extra_element' ? 'onomasticon-extra-element',
  12. implement == 'extra_element' ? 'onomasticon-orientation-' ~ orientation,
  13. cursor == default ? '' : 'onomasticon-cursor-' ~ cursor,
  14. ]
  15. %}
  16. {% if implement == 'extra_element' %}
  17. <{{ tag }} {{ attributes.addClass(classes) }} tabindex="0" title="{{ needle }}">
  18. <button disabled="disabled" class="onomasticon-term-description">{{ description }}{% if termlink %}<p><a href="{{ termpath }}" class="use-ajax" data-dialog-type="dialog" data-dialog-renderer="off_canvas" data-dialog-options="" title="{{ needle }}">read more</a></p>{% endif %}</button>
  19. </{{ tag }}>
  20. {% else %}
  21. <{{ tag }} {{ attributes.addClass(classes) }} title="{{ description }}">{{ needle }}</{{ tag }}>
  22. {% endif %}