Document Body
cf_CacheOMatic
<cf_CacheOMatic key="dspPrimaryNav#$.content('contentid')#"> Your code goes here. </cf_CacheOMatic>
The cf_CacheOMatic tag can be used to cache less frequently updated items that have greater application server overhead. It is used in conjunction with the "Caching" option under Site Config > Edit Site. The cf_CacheOMatic tag will not actually cache anything unless the site's caching is turned on. The "key" attribute's prefix (in this case, dspPrimaryNav) can be used to give context to the unique variable, #$.content('contentid')#, created for the cached item.
Primary Navigation
#$.dspPrimaryNav( viewDepth=1 , id='navPrimary' , class='nav navbar-nav' , displayHome='never' , closeFolders=false , showCurrentChildrenOnly=false , liHasKidsClass='dropdown' , liHasKidsAttributes='' , liCurrentClass='' , liCurrentAttributes='' , liHasKidsNestedClass='dropdown-submenu' , aHasKidsClass='dropdown-toggle' , aHasKidsAttributes='role="button" data-toggle="dropdown" data-target="##"' , aCurrentClass='' , aCurrentAttributes='' , ulNestedClass='dropdown-menu' , ulNestedAttributes='' , aNotCurrentClass='' , siteid=$.event('siteid') )#
Available Arguments for dspPrimaryNav()
Argument | 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
|
liHasKidsClass | string | Opt |
|
|
liHasKidsAttributes | string | Opt |
|
|
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 |
|
|
aHasKidsAttributes | string | Opt |
|
|
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 |
|
|
ulNestedAttributes | string | Opt |
|
|
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. |
Page Title, Body, and Primary Associated Image
The page title and body (content) are formatted and output with the following code:
#$.dspBody( body=$.content('body') , pageTitle=$.content('title') , crumbList=false , showMetaImage=true , metaImageSizeArgs={size='custom',height=100,width=100} )#
If you need to separate the page title from the body content in your templates for layout purposes, you can output the page title with this code:
<h2 class="pageTitle">#HTMLEditFormat($.content('title'))#</h2>
If you do this, then you will want to pass in an empty string to the pageTitle argument, such as:
#$.dspBody( body=$.content('body') , pageTitle='' , crumbList=false , showMetaImage=true , metaImageSizeArgs={size='medium'} )
The body content can be output independently of the page title using the code below.
Note: It is not recommended to output the body area this way for a number of reasons. First, if a content item is protected, you will have to write additional code to make sure that the user is logged in to view the content, otherwise it will display by default. Also, some content types will not display as expected, such as Folders. It is highly recommended that you use the $.dspBody() method instead.
#$.content('body')#