page-manager-wizard-tree.html.twig in Page Manager 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 page-manager-wizard-tree.html.twig
- PageEditWizard::customizeForm in page_manager_ui/
src/ Wizard/ PageEditWizard.php - Helper function for generating label and id form elements.
File
page_manager_ui/templates/page-manager-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
- */
- #}
-
- {{ attach_library('page_manager_ui/page_variants') }}
-
- {% import _self as page_manager %}
-
- {#
- We call a macro which calls itself to render the full tree.
- @see http://twig.sensiolabs.org/doc/tags/macro.html
- #}
- {{ page_manager.wizard_tree(tree, step, 0) }}
-
- {% macro wizard_tree(items, step, menu_level) %}
- {% import _self as page_manager %}
- {% if items %}
- <ul class="page__section__{{ menu_level }}">
-
- {% for item in items %}
- {% if step is same as(item.step) %}
- {% set active_class = " current_variant" %}
- {% else %}
- {% set active_class = "" %}
- {% endif %}
- <li class="page__section_item__{{ menu_level }}{{ active_class }}">
- <label class="page__section__label">
- {% 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 %}
- </label>
- {% if item.children %}
- {{ page_manager.wizard_tree(item.children, step, menu_level + 1) }}
- {% endif %}
- </li>
- {% endfor %}
- </ul>
- {% endif %}
- {% endmacro %}