Skip to content

Instantly share code, notes, and snippets.

@Dan4IT
Last active January 28, 2016 05:13
Show Gist options
  • Save Dan4IT/8abf80dd09b8e93fe2ec to your computer and use it in GitHub Desktop.
Save Dan4IT/8abf80dd09b8e93fe2ec to your computer and use it in GitHub Desktop.
Mura Extended Attributes
<!--- There are many ways you can display extended attributes. The most common way to display the value of an attribute is to use the content bean from the event upon rendering and ask for the attribute. This can be done by using the below code: --->
<cfoutput>#$.content( {attributeName} )#</cfoutput>
<cfoutput>#$.content('productPrice')#</cfoutput>
[mura]$.content('productPrice')[/mura]
<!--- Display Extended Attribute Image, including custom image size - within Iterator --->
<img alt="#sub1.getMenuTitle()#" class="img-responsive" src="#$.getURLForImage(sub1.getfilethumbnail(size = 'standardimage'))#">
<!--- Method on displaying Mura extended attribute images, including custom image sizes --->
<!--- Assuming you've created an extended attribute 'File' type called 'extAttributeImage' --->
<!--- In a Mura Page Template --->
#$.createHREFForImage(filename=$.content('extAttributeImage'),size='myCustomSize')#
<!--- In a Mura Component --->
#$.createHREFForImage(filename=$.component('extAttributeImage'),size='myCustomSize')#
<!--- In the context of an iterator --->
#$.createHREFForImage(filename=item.getExtAttributeImage(),size='myCustomSize')#
<!--- Get URL for a Mura extended attribute file --->
<!--- In a Mura page template --->
#$.getURLForFile(filename=$.content('extAttribute')#
<!--- In a Mura component --->
#$.getURLForFile(filename=$.component('extAttribute')#
<!--- In a Mura iterator --->
#$.getURLForFile(filename=item.getExtAttribute())#
<!-- In an Iterator --->
<cfset sub1=it.next()>
#sub1.getValue('ExtendedAttributeName')#
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment