Page Label Menu
This menu requires a few of the following radius tags along with a standard HTML menu structure.
This starts us in the root of the site:
<r:root>
This selects all pages in your site that have been labeled "name-of-your-label":
<r:descendants:each labels="name-of-your-label">
Use the
<a>
tag with
<r:page:url />
and
<r:page:name />
to dynamically create the page link and title
in the menu.
<a href="<r:page:url />"><r:page:name /></a>
Example:
<r:root>
<ul>
<r:descendants:each labels="name-of-your-label">
<li>
<a href="<r:page:url />"><r:page:name /></a>
</li>
</r:descendants:each>
</ul>
</r:root>
Note: Make sure the pages you're including in your Page Label Menu are not hidden. Also, make sure they've been published.
Note 2: To select pages with labels only at the root level, use r:children
instead of r:descendants
.
Note 3: Want to use more than one label? Separate multiple labels with
commas. Do not include a space. For example:
labels="first-label,second-label"
This menu requires the following Liquid tags along with a standard HTML menu structure.
This starts us in the root of the site:
{% assign pages = site.pages %}
This selects all pages in your site that have been labeled "name-of-your-label"
:
{% assign pages = site.pages | filter_pages: tags: "name-of-your-label" %}
Use the <a>
tag with {{ page.url }}
and {{ page.name }}
to dynamically create the page link and name in the menu.
Example:
{% assign pages = site.pages | filter_pages: tags: "name-of-your-label" %}
<ul>
{% for page in pages.all %}
<li>
<a href="{{ page.url }}">{{ page.name }}</a>
</li>
{% endfor %}
</ul>
Note: Make sure the pages you're including in your Page Label Menu are not hidden. Also, make sure they've been published.
Note 2: To select pages with labels only at the root level, use site.base_pages
instead of site.pages
.
Note 3: Want to use more than one label? Separate multiple labels with
commas. Do not include a space. For example:
tags: "first-label,second-label"
.
Last updated on March 15, 2021.
We welcome all questions, feedback and bug reports. If you're having an issue, we usually need the following information:
- A brief description of the issue
- A link to the page where you saw the issue
- Screenshots that illustrate the problem - How do I take a screenshot?
Kindly email CleanSlate@mail.wvu.edu for help or use the form on the request help page.