obtain the relative href of a custom page
I'm trying to do set a class for styling the header navigation for a set of custom pages. How I do it for other categories is by the following code:
<#if category.id == coreNode.id || isAncestor(category.id coreNode.ancestors) > <#assign category_highlight_class = " custom-menu-item-underline" /> </#if>
However, this doesn't work for custom pages I've created.
I thought I could do something similar, perhaps with the href parameter:
<#if coreNode.href == "RELATIVE_URL") > <#assign category_highlight_class = " custom-menu-item-underline" /> </#if>
But I can't get coreNode.href to return values for any page on the site, much less custom pages. I get the following error every time:
The following has evaluated to null or missing: ==> coreNode.href
Any ideas what I'm doing wrong?
What is the best way to work with custom pages that don't have categories or standard nodes?
sdodds - coreNode context object will not work unless you bind custom page to any category or board. However, you can use page.name context object for the custom pages. It will return you the custom page name.
E.g http://mycomunity.lithium.com/t5/custom/page/page-id/my-custom-page
${page.name} will return the my-custom-page for above URL.