Document Body - Mura Docs v6

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 id attribute of the opening <ul> element used to output primary navigation.

class String Opt  

This is the class attribute of the opening <ul> element used to output primary navigation.

displayHome String Opt conditional

This controls whether or not a 'Home' link appears in the primary navigation. Valid options are:

  • conditional - does not display a link to 'Home' when viewing the Home page itself, but will display at all other times
  • always - a link to 'Home' will appear at all times
  • never - a link to 'Home' will never appear
closeFolders string Opt  

This controls the visibility of a Folder's child links. Valid options are:

  • true
  • false
  • A comma-delimited list of ContentID's (found on the 'advanced' tab of any content item).
openFolders string Opt  

This controls the visibility of a Folder's child links. Valid options are:

  • true
  • false
  • A comma-delimited list of ContentID's (found on the 'advanced' tab of any content item).
showCurrentChildrenOnly boolean Opt false

This controls the visibility of a content item's child links. If true, then child links will only appear for the section currently being viewed on the front end of the site. This can be useful when creating a vertical oriented navigation. Valid options are:

  • true
  • false
liHasKidsClass string Opt  

 

liHasKidsAttributes string Opt  

 

liCurrentClass string Opt  

Control the class attribute of the current <li> element.

Also configurable via the Site or Theme contentRenderer.cfc's this.liCurrentClass setting.

liCurrentAttributes string Opt  

Optionally pass in any additional attributes to output with the current <li> element.

liHasKidsNestedClass string Opt  

Control the class attribute of any <li> element that has children. Useful for adding markup that will include icons such as arrows, etc.

Also configurable via the Site or Theme contentRenderer.cfc's this.liHasKidsNestedClass setting.

aHasKidsClass string Opt  

 

aHasKidsAttributes string Opt  

 

aCurrentClass string Opt current

Control the class attribute of the current <a> element.

Also configurable via the Site or Theme contentRenderer.cfc's this.aCurrentClass setting.

aCurrentAttributes string Opt  

Optionally pass in any additional attributes to output with the current <a> element.

Also configurable via the Site or Theme contentRenderer.cfc's this.aCurrentAttributes setting.

ulNestedClass string Opt  

 

ulNestedAttributes string Opt  

 

aNotCurrentClass string Opt  

Control the class attribute of all <a> elements that are not currently active or currently being viewed.

Also configurable via the Site or Theme contentRenderer.cfc's this.aNotCurrentClass setting.

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')#