dspBody
A Mura Scope helper method to dynamically output the body/content of a content item. This function automatically checks the content type, and displays output accordingly (e.g., if a Mura "Folder" or "Calendar", will output the children). Additionally, Mura checks to see if the content is restricted/protected, and if so, checks to see if the current user is logged in. If not logged in, will display a login screen. If user is logged in and does not have the required permissions, Mura will display a message to the user in lieu of the content.
Function Syntax
m.dspBody( body , pageTitle , crumbList , crumbSeparator , showMetaImage , metaImageSizeArgs , metaImageClass , includeMetaHREF )
Parameters
| Parameter | Type | Req/Opt | Default | Description |
|---|---|---|---|---|
| body | string | Opt | m.content('body') |
This is the primary content/body of a content item. If you omit this parameter, Mura will automatically use the content/body of the current content item. |
| pageTitle | string | Opt | empty string |
If you wish to display a title above the body/content, you may optionally pass in a title. For example: |
| crumbList | boolean | Opt | true |
If
|
| crumbSeparater | string | Opt | » |
If |
| showMetaImage | boolean | Opt | true |
If
|
| metaImageSizeArgs | struct | Opt | {size='medium'} |
An object/struct (list of key-value pairs) to be passed to the
|
| metaImageClass | string | Opt | empty string |
This is the |
| includeMetaHREF | boolean | Opt | true |
If
|
Usage
Use this function to output the main content/body of a content item.
Example
The following example outputs the content/body, without a page title or breadcrumbs, while outputting the associated image (if one exists) using the 'medium' image size.
<cfoutput>
<article>
#m.dspBody(
body=m.content('body')
, pageTitle=''
, crumbList=false
, showMetaImage=true
, metaImageSizeArgs={size='medium'}
)#
</article>
</cfoutput>