dspPrimaryNav
A Mura Scope helper method to dynamically output primary navigation. Mura also checks a user's permissions, and will only display links to content the user has access to. If a section of a site is restricted, a link will be generated to the topmost content item only. If a user visits that link, they will be presented with a login screen, if they're not currently logged in, or if they are logged in and don't have access, a message will inform the user they do not have the proper authorization.
Function Syntax
m.dspPrimaryNav( viewDepth , id , class , displayHome , closeFolders , openFolders , showCurrentChildrenOnly , liClass , liHasKidsClass , liHasKidsAttributes , liCurrentClass , liCurrentAttributes , liHasKidsNestedClass , aHasKidsClass , aHasKidsAttributes , aCurrentClass , aCurrentAttributes , ulNestedClass , ulNestedAttributes , aNotCurrentClass , siteid , complete )
Parameters
Parameter | Type | Req/Opt | Default | Description |
---|---|---|---|---|
viewDepth | Numeric | Opt | 1 |
Expects a numeric value to indicate how 'deep' each top level nav should go when listing its children. It is not recommended to set this greater than 1 or 2 due to the overhead required to parse a node's 'current' location and permissions. Setting it to a '0' results in no dropdowns or more specifically, no output of links to child nodes. |
id | String | Opt | navPrimary |
This is the |
class | String | Opt |
This is the |
|
displayHome | String | Opt | conditional |
This controls whether or not a 'Home' link appears in the primary navigation. Valid options are:
|
closeFolders | string | Opt |
This controls the visibility of a Folder's child links. Valid options are:
|
|
openFolders | string | Opt |
This controls the visibility of a Folder's child links. Valid options are:
|
|
showCurrentChildrenOnly | boolean | Opt | false |
This controls the visibility of a content item's child links. If
|
liClass | string | Opt |
Controls the |
|
liHasKidsClass | string | Opt |
Controls the |
|
liHasKidsAttributes | string | Opt |
Optionally pass in any additional attributes to output with |
|
liCurrentClass | string | Opt |
Control the Also configurable via the Site or Theme contentRenderer.cfc's |
|
liCurrentAttributes | string | Opt |
Optionally pass in any additional attributes to output with the current |
|
liHasKidsNestedClass | string | Opt |
Control the Also configurable via the Site or Theme contentRenderer.cfc's |
|
aHasKidsClass | string | Opt |
Control the |
|
aHasKidsAttributes | string | Opt |
Optionally pass in any additional attributes to output with |
|
aCurrentClass | string | Opt | current |
Control the Also configurable via the Site or Theme contentRenderer.cfc's |
aCurrentAttributes | string | Opt |
Optionally pass in any additional attributes to output with the current Also configurable via the Site or Theme contentRenderer.cfc's |
|
ulNestedClass | string | Opt |
Control the |
|
ulNestedAttributes | string | Opt |
Optionally pass in any additional attributes to output with |
|
aNotCurrentClass | string | Opt |
Control the Also configurable via the Site or Theme contentRenderer.cfc's |
|
siteID | string | Opt | $.event('siteid') |
You can optionally pass in a SiteID from another site managed under the same installation. It default's to the SiteID of the site currently being visited. |
complete | boolean | Opt | false |
If
|
Usage
Use this function to output primary navigation.
Example
The following example outputs the primary nav up to two-levels deep.
<cfoutput> <nav> #m.dspPrimaryNav( viewDepth=2 , id='navPrimary' , class='nav navbar-nav' , displayHome='always' , closeFolders=false , showCurrentChildrenOnly=false , ulNestedClass='dropdown-menu' , liHasKidsNestedClass='dropdown-submenu' , aHasKidsClass='dropdown-toggle' , aHasKidsAttributes='role="button" data-toggle="dropdown" data-target="##"' )# </nav> </cfoutput>