Skip to content

Instantly share code, notes, and snippets.

@stevewithington
Last active November 4, 2015 22:07
Show Gist options
  • Save stevewithington/57f4947d19e05f5232ce to your computer and use it in GitHub Desktop.
Save stevewithington/57f4947d19e05f5232ce to your computer and use it in GitHub Desktop.
Mura CMS: Example of how to show a different body region for mobile users.
<?xml version="1.0" encoding="UTF-8"?>
<mura>
<extensions>
<extension adminonly="0" availablesubtypes="" basekeyfield="contentHistID" basetable="tcontent" datatable="tclassextenddata" description="" hasassocfile="1" hasbody="1" hasconfigurator="0" hassummary="1" iconclass="" subtype="Default" type="Base">
<attributeset categoryid="" container="Basic" name="Mobile Options" orderno="1">
<attribute adminonly="0" defaultvalue="" hint="" label="Mobile Body" message="" name="mobileBody" optionlabellist="" optionlist="" orderno="1" regex="" required="false" type="HTMLEditor" validation=""/>
</attributeset>
</extension>
</extensions>
</mura>
<!--- Create the class extension using the config.xml.cfm file below FIRST --->
<cfset myBody = cookie.mobileformat && Len($.content('mobileBody'))
? $.content('mobileBody')
: $.content('body') />
#$.dspBody(
body=myBody
, pageTitle=$.content('title')
, crumbList=false
, showMetaImage=true
, metaImageClass='thumbnail'
)#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment