You are here

panelizer-wizard-tree.html.twig in Panelizer 8.4

Default theme implementation to display wizard tree.

Available variables:

  • step: The current step name.
  • tree: A nested list of menu items. Each menu item contains:
    • title: The menu link title.
    • url: The menu link url, instance of \Drupal\Core\Url
    • children: The menu item child items.
    • step: The name of the step.

File

templates/panelizer-wizard-tree.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation to display wizard tree.
  5. *
  6. * Available variables:
  7. * - step: The current step name.
  8. * - tree: A nested list of menu items. Each menu item contains:
  9. * - title: The menu link title.
  10. * - url: The menu link url, instance of \Drupal\Core\Url
  11. * - children: The menu item child items.
  12. * - step: The name of the step.
  13. *
  14. * @ingroup themeable
  15. */
  16. #}
  17. {% import _self as panelizer %}
  18. {#
  19. We call a macro which calls itself to render the full tree.
  20. @see http://twig.sensiolabs.org/doc/tags/macro.html
  21. #}
  22. {{ panelizer.wizard_tree(tree, step, 0) }}
  23. {% macro wizard_tree(items, step, menu_level) %}
  24. {% import _self as panelizer %}
  25. {% if items %}
  26. <ul>
  27. {% for item in items %}
  28. <li>
  29. {% if item.url %}
  30. {% if step is same as(item.step) %}
  31. <strong>{{ link(item.title, item.url) }}</strong>
  32. {% else %}
  33. {{ link(item.title, item.url) }}
  34. {% endif %}
  35. {% else %}
  36. {{ item.title }}
  37. {% endif %}
  38. {% if item.children %}
  39. {{ panelizer.wizard_tree(item.children, step, menu_level + 1) }}
  40. {% endif %}
  41. </li>
  42. {% endfor %}
  43. </ul>
  44. {% endif %}
  45. {% endmacro %}