-
-
Save Grant-Smith-74/6f7c11f4175157311378e4ae6e623bca to your computer and use it in GitHub Desktop.
Add category links as sub-menus to Perch CMS navigation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--* | |
// ==================================================================== | |
// MAIN MENU LIST ITEMS | |
// ==================================================================== | |
// this is the primary navigation item template (/perch/templates/navigation/custom/item.html) | |
// called by perch_pages_navigation(); | |
*--> | |
<perch:before><nav id="nav" class="nav" role="navigation" aria-labelled-by="nav2"> | |
<p><a class="skip" href="#menu">Menu</a></p> | |
<ul id="menu"> | |
</perch:before><li class="<perch:if exists="subitems">has-subitems</perch:if><perch:if id="pagePath" match="in" value="/where-to-stay, /walking">has-subitems</perch:if><perch:if exists="current_page"> selected</perch:if><perch:if exists="ancestor_page"> ancestor</perch:if>"><a href="<perch:pages id="pagePath" />"><perch:pages id="pageNavText" /></a><perch:pages id="subitems" encode="false" /> | |
<perch:if id="pagePath" match="eq" value="/where-to-stay"><perch:pages id="cats_accommodation" encode="false" /></perch:if> | |
<perch:if id="pagePath" match="eq" value="/walking"><perch:pages id="cats_walks" encode="false" /></perch:if> | |
</li><perch:after> | |
</ul> | |
</nav></perch:after> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--* | |
// ==================================================================== | |
// SUB MENU LIST ITEMS | |
// ==================================================================== | |
// this is the secondary / sub-menu navigation item template (/perch/templates/navigation/custom/subitem.html) | |
// called by perch_pages_navigation(); | |
*--> | |
<perch:before><ul class="sub-menu"></perch:before> | |
<li<perch:if exists="current_page"> class="selected"</perch:if>><a href="<perch:pages id="pagePath" />"><perch:pages id="pageNavText" /></a> | |
</li> | |
<perch:after></ul></perch:after> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment