This file contains 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
<!--- Drop this into your site eventhandler.cfc ---> | |
<cffunction name="onAfterFormSubmitSave" output="true"> | |
<cfif $.event('formid') EQ '{ID of the Mura form}'> | |
<!--- Get the form result ---> | |
<cfset formBean = $.event().getValue('formresult')> | |
<!--- Get a new content bean ---> | |
<cfset cBean = application.contentManager.getBean()> | |
<!--- Set the new node attributes ---> | |
<cfset cBean.setSiteID($.event('siteid'))> |
This file contains 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
<cffunction name="onAfterFormSubmitSave"> | |
<cfargument name="$"> | |
<cfif $.content('title') eq "{content Title}"> | |
<!--- Send Sales Leads to SalesForce ---> | |
<cfhttp method="post" url="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8"> | |
<cfhttpparam type="formfield" name="oid" value="XXXXXXXXXXX"/> | |
<cfhttpparam type="formfield" name="retURL" value="http://www.domain.com"/> | |
<!--- | |
<cfhttpparam type="formfield" name="debug" value="1"/> | |
<cfhttpparam type="formfield" name="debugEmail" value="[email protected]"/> |
This file contains 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
<!--- if using CFStatic ---> | |
<cf_CacheOMatic key="isotopeCSS"> | |
#$.static() | |
.include('/css/isotope/') | |
.renderIncludes('css')# | |
</cf_CacheOMatic> | |
<!--- Static CSS Include ---> | |
<!--- <link rel="stylesheet" href="#$.siteConfig('themeAssetPath')#/css/isotope/isotope.css"> ---> |
This file contains 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
<!--- 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')# |
This file contains 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
<!--- Assuming you have a url query called "sku", i.e. ?sku=12345678 ---> | |
<!--- load product options by predefined SKU ---> | |
<cfset defaultSelectedOptions = $.slatwall.getEntity('Sku', 'url.sku').getOptionsIDList() /> |
This file contains 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
<!--- Create new Slatwall Object Programatically ---> | |
<cfset newBrand = $.slatwall.newEntity('Brand') /> | |
<cfset newBrand.setBrandName("Hello World") /> | |
<cfset newBrand.setURLTitle("hello-world") /> | |
<cfset newbrand = $.slatwall.saveEntity( newBrand ) /> | |
<!--- Update existing Slatwall Object Programatically ---> |
This file contains 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
<!--- Add to site Content Renderer ---> | |
<cffunction name="feedList"> | |
<cfargument name="columnName" type="string" required="Yes"> | |
<cfargument name="delimiter" type="string" default=","> | |
<cfset var q = application.feedManager.getFeeds(siteId = $.event('siteId'),type='Local')> | |
<cfreturn arrayToList(q[arguments.columnName].toArray(), arguments.delimiter)> | |
</cffunction> |
This file contains 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
<!--- 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())# |
This file contains 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
<!--- Sometimes you need to output the contents of an iterator multiple times. For example, for a slider with navigation, you may want to output the links as an unordered list and the images as divs ---> | |
<cfoutput> | |
<cfset feed=$.getBean("feed").loadBy(name="Feed Name",siteID=$.event("siteid"))> | |
<cfset iterator=feed.getIterator()> | |
<cfif iterator.hasNext()> | |
<ul> | |
<!--- The list ---> |
This file contains 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
<!--- Get the parent of a page ---> | |
#$.content().getParent()# | |
<!--- Get the Paren't title ---> | |
#$.content().getParent().getTitle()# | |
<!--- Get the Parent's image ---> | |
#$.content().getParent().getImageURL('large')# | |
<!--- You could also simply set the parent in a variable and grab the objects accordingly ---> |
OlderNewer