help-section.html.twig in Drupal 10
Same filename in this branch
- 10 core/modules/help/templates/help-section.html.twig
- 10 core/themes/starterkit_theme/templates/misc/help-section.html.twig
- 10 core/themes/classy/templates/misc/help-section.html.twig
- 10 core/themes/stable9/templates/admin/help-section.html.twig
- 10 core/themes/stable/templates/admin/help-section.html.twig
- 10 core/themes/claro/templates/classy/misc/help-section.html.twig
- 10 core/themes/seven/templates/classy/misc/help-section.html.twig
- 10 core/themes/bartik/templates/classy/misc/help-section.html.twig
- 10 core/profiles/demo_umami/themes/umami/templates/classy/misc/help-section.html.twig
Same filename and directory in other branches
Theme override for a section of the help page.
This implementation divides the links into 4 columns.
Available variables:
- title: The section title.
- description: The description text for the section.
- links: Links to display in the section.
- empty: Text to display if there are no links.
1 theme call to help-section.html.twig
- HelpController::helpMain in core/
modules/ help/ src/ Controller/ HelpController.php - Prints a page listing various types of help.
File
core/themes/seven/templates/classy/misc/help-section.html.twigView source
- {#
- /**
- * @file
- * Theme override for a section of the help page.
- *
- * This implementation divides the links into 4 columns.
- *
- * Available variables:
- * - title: The section title.
- * - description: The description text for the section.
- * - links: Links to display in the section.
- * - empty: Text to display if there are no links.
- */
- #}
- <div class="clearfix">
- <h2>{{ title }}</h2>
- <p>{{ description }}</p>
- {% if links %}
- {# Calculate the column length, to divide links into 4 columns. #}
- {% set size = links|length // 4 %}
- {% if size * 4 < links|length %}
- {% set size = size + 1 %}
- {% endif %}
-
- {# Output the links in 4 columns. #}
- {% set count = 0 %}
- {% for link in links %}
- {% if count == 0 %}
- {# Start a new column. #}
- <div class="layout-column layout-column--quarter"><ul>
- {% endif %}
- <li>{{ link }}</li>
- {% set count = count + 1 %}
- {% if count >= size %}
- {# End the current column. #}
- {% set count = 0 %}
- </ul></div>
- {% endif %}
- {% endfor %}
-
- {# End the last column, if one is open. #}
- {% if count > 0 %}
- </ul></div>
- {% endif %}
- {% else %}
- <p>{{ empty }}</p>
- {% endif %}
- </div>