Skip to content

Instantly share code, notes, and snippets.

@modmedia
Created January 18, 2014 21:53
Show Gist options
  • Save modmedia/8497175 to your computer and use it in GitHub Desktop.
Save modmedia/8497175 to your computer and use it in GitHub Desktop.
Slatwall - Create new products programatically
<!--- 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 --->
<cfset product = $.slatwall.getEntity('Product','productid') />
<cfset roduct.setProductName("Hello World") /> <!--- if you want to change the product name to Hello World --->
<cfset product.setBrand("someBrand") />
<cfset product = $.slatwall.saveEntity( product ) />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment