Last active
January 17, 2016 01:13
-
-
Save ronnieduke/87c31b7c7f733674bcf9 to your computer and use it in GitHub Desktop.
Mura Code Snippets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============================= | |
Content Image | |
============================= | |
<img src="#$.content().getImageURL(size='large')#" /> | |
============================= | |
Extended Attribute Image | |
============================= | |
<!--- First, create an extended attribute with the type of 'File' ---> | |
<img src="#$.createHREFForImage(filename=$.content('myExtAttribute'))#" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- First, Create a feed in your Admin > Content Collections ---> | |
<cfoutput> | |
<cfset feed=$.getBean("feed").loadBy(name="Feed Name",siteID=$.event("siteid"))> | |
<cfset iterator=feed.getIterator()> | |
<cfif iterator.hasNext()> | |
<div> | |
<cfloop condition="iterator.hasNext()"> | |
<cfset item=iterator.next()> | |
<p>looped content here</p> | |
</cfloop> | |
</div> | |
</cfif> | |
</cfoutput> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
============================= | |
Theme Asset Path | |
============================= | |
#$.siteConfig('themeAssetPath')# | |
============================= | |
Display Regions | |
============================= | |
#$.dspObjects(1)# - Left Sidebar | |
#$.dspObjects(2)# - Main Content | |
#$.dspObjects(3)# - Right Sidebar | |
============================= | |
Body | |
============================= | |
#$.dspBody( | |
body=$.content('body') | |
, pageTitle=$.content('title') <!--- Change to '' to exclude the page title ---> | |
, crumbList=false | |
, showMetaImage=true | |
, metaImageClass='thumbnail' | |
)# | |
============================= | |
Page Attributes | |
============================= | |
<!--- Page Title ---> | |
#$.content('title')# | |
<!--- Page Navigation Title ---> | |
#$.content('menuTitle')# | |
<!--- Page Author/Credits ---> | |
#$.content('credits')# | |
<!--- Dump All Page Values ---> | |
<cfdump var="#$.content().getAllValues()#"> | |
============================= | |
Create Dynamic CSS Hook | |
============================= | |
#$.createCSSHook($.content('menuTitle'))# <!--- Replace with any dynamic value you want ---> | |
============================= | |
Breadcrumbs | |
============================= | |
<nav>#$.dspCrumbListLinks()#</nav> | |
============================= | |
Primary Navigation | |
============================= | |
#$.dspPrimaryNav( | |
viewDepth=1 | |
, id='navPrimary' | |
, class='nav navbar-nav' | |
, displayHome='always' | |
, closeFolders=true | |
, showCurrentChildrenOnly=false | |
, ulTopClass='nav navbar-nav' | |
, ulNestedClass='dropdown-menu' | |
, liHasKidsClass='dropdown' | |
, liHasKidsAttributes='' | |
, liHasKidsNestedClass='dropdown-submenu' | |
, liNestedClass='' | |
, aHasKidsClass='dropdown-toggle' | |
, aHasKidsAttributes='role="button" data-toggle="dropdown" data-target="##"' | |
, liCurrentClass='' | |
, aCurrentClass='' | |
, siteid=$.event('siteid') | |
)# | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment