Commit 9e63ae21 authored by James Wilson's avatar James Wilson
Browse files

Issue #3284338 by jwilson3: Hide section nav if content empty

parent 45b5b5d8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -4,8 +4,14 @@
 * Override the system menu block to match IU Framework expectations.
 */
 #}
{% set hasContent = FALSE %}
{% for key, child in element if key|first != '#' %}
  {% set hasContent = TRUE %}
{% endfor %}
{% if hasContent %}
<nav{{ attributes }} role="navigation" aria-label=" {{ 'Section navigation'|t }}" itemscope="itemscope" itemtype="http://schema.org/SiteNavigationElement">
  {{ title_prefix }}{{ title_suffix }}
  <span class="section-nav-label">In this section</span>
  {{ content }}
</nav>
{% endif %}