Forum Discussion

sdodds's avatar
sdodds
Expert
8 years ago

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?