Mobile Content - Mura Docs v6

Mobile Content

If you open the mobile.cfm layout template, you may notice a section of the page that looks something like the following:

<cfif YesNoFormat($.content('hasMobileBody'))>
#$.dspBody(
body=$.content('mobileBody')
,pageTitle=''
,crumbList=0
,showMetaImage=0
)#
<cfelse>
#$.dspBody(
body=$.content('body')
,pageTitle=''
,crumbList=0
,showMetaImage=0
)#
</cfif>

The first line of code is checking for an extended attribute called hasMobileBody.  If it exists, and the field is set to true, then the $.dspBody() method will use the content entered into the mobileBody field.

By default, these fields do not exist.  However, you could either manually create these extended attributes using the Class Extension Manager, or simply uncomment the section in the included config.xml.cfm file that contains the following code:

<theme>
<extensions>
<extension type="Base" subType="Default">
<attributeset name="Mobile Options" container="Basic">
<attribute
name="hasMobileBody"
label="Has Mobile Content?"
hint="If you have mobile-specific content, select Yes."
type="RadioGroup"
defaultValue="false"
required="false"
validation=""
regex=""
message=""
optionList="true^false"
optionLabelList="Yes^No" />
<attribute
name="mobileBody"
label="Mobile Content"
hint="Enter any mobile-specific content here."
type="HTMLEditor"
defaultValue=""
required="false"
validation=""
regex=""
message=""
optionList=""
optionLabelList="" />
</attributeset>
</extension>
</extensions>
</theme>

After you uncomment (or even create your own) config.xml.cfm file with the code above, make sure it resides in the root of your theme: {context}/{SiteID}/includes/themes/{ThemeName}/config.xml.cfm

Then, Reload Application. When you add or edit content, you should now see a new set of Mobile Options form fields.