Navigation Section Properties

Navigation Section Properties

If you need your menu navigation to reflect properties from Properties >> Navigation section of a page, you need to implement a logic to your item transformation.

These are the following CMS_Document database table columns belonging to Navigation section properties:

[DocumentMenuCaption]
[DocumentMenuStyle]
[DocumentMenuItemImage]
[DocumentMenuItemLeftImage]
[DocumentMenuItemRightImage]
[DocumentMenuJavascript]
[DocumentMenuRedirectUrl]
[DocumentMenuClass]
[DocumentMenuStyleHighlighted]
[DocumentMenuClassHighlighted]
[DocumentMenuItemImageHighlighted]
[DocumentMenuItemLeftImageHighlighted]
[DocumentMenuItemRightImageHighlighted]
[DocumentMenuItemInactive]

Menu Caption Macro
In order to use the Caption Menu available under Navigation properties change the macro in your menu transformation from {% DocumentName %} to {% DocumentMenuCaption %}.
But then, every page that doesn’t use the Menu Caption would not show.

To fix the issue check if the Menu Caption (DocumentMenuCaption) property is not empty and if it is displays the default Page Name (DocumentName).

To find out if some property is empty or not you can use either String.IsNullOrEmpty(DocumentMenuCaption) or DocumentMenuCaption.ToString()==”” in your transformation macro.

Here’s the macro to be used:

{% HTMLEncode(DocumentMenuCaption.ToString()!=""?DocumentMenuCaption:DocumentName) %}

The above macro checks if there is any DocumentMenuCaption specified and if it’s not it uses DocumentName instead.

Menu Caption Macro

Menu Actions
Inactive menu item redirect to URL:

{% (DocumentMenuItemInactive && DocumentMenuRedirectUrl.ToString()=="")?"":"href='"+GetDocumentUrl()+"' ") %}

Javascript Command:

{% (DocumentMenuJavascript.ToString()!=""?"onclick=\""+DocumentMenuJavascript+"\" ":"") %}

Menu Design:

Menu item style:

{% (DocumentMenuStyle.ToString()!=""?"style='"+DocumentMenuStyle+"' ":"") %} 

Menu item CSS class:

class='{% (DocumentMenuClass.ToString()!=""?DocumentMenuClass:"DefaultClassOrNothing") %}'