panelizer-wizard-tree.html.twig in Panelizer 8.4
Same filename and directory in other branches
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.
1 theme call to panelizer-wizard-tree.html.twig
- PanelizerEditWizard::customizeForm in src/
Wizard/ PanelizerEditWizard.php - Helper function for generating default form elements.
File
templates/panelizer-wizard-tree.html.twigView source
- {#
- /**
- * @file
- * 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.
- *
- * @ingroup themeable
- */
- #}
- {% import _self as panelizer %}
-
- {#
- We call a macro which calls itself to render the full tree.
- @see http://twig.sensiolabs.org/doc/tags/macro.html
- #}
- {{ panelizer.wizard_tree(tree, step, 0) }}
-
- {% macro wizard_tree(items, step, menu_level) %}
- {% import _self as panelizer %}
- {% if items %}
- <ul>
- {% for item in items %}
- <li>
- {% if item.url %}
- {% if step is same as(item.step) %}
- <strong>{{ link(item.title, item.url) }}</strong>
- {% else %}
- {{ link(item.title, item.url) }}
- {% endif %}
- {% else %}
- {{ item.title }}
- {% endif %}
- {% if item.children %}
- {{ panelizer.wizard_tree(item.children, step, menu_level + 1) }}
- {% endif %}
- </li>
- {% endfor %}
- </ul>
- {% endif %}
- {% endmacro %}