asset_url

Generates a path directly to the asset URL for the active theme.

Example

[%asset_url type:'content' id:'[@content_id@]' default:'/assets/pixel.gif'/%]

Asset URLs of type logo also have thumb options:

[%asset_url type:'logo' thumb:'pdf'/%]

Usage

An asset_url will call an asset that has been loaded into Maropost Commerce Cloud's control panel. For instance, the example above will load the primary main content image for a content page for whatever the current page is. You can also specific a content pages alt_1 image like the following:

<img src="[%asset_url type:'content' thumb:'alt_1' id:'[@content_id@]' default:'[@config:imageurl@]/pixel.gif'%][%END ASSET_URL%]" alt="[@name@] image"/>

Or a products main image with:

<img src="[%asset_url type:'product' id:'[@SKU@]' thumb:'full'%][%param default%][%cdn_asset html:'0' library:'images'%]default_product.gif[%/cdn_asset%][%/param%][%/ asset_url%]"/>

Parameters

Name Options Description
`type:''` `adw`, `brochure`, `content`, `itemspecific`, `logo`, `product`, `user`, `order` Directs the url to a specific content type
`id:''` String See the **Available Options** table below for options
`thumb:''` String See the **Available Options** table below for options
`default:''` String The url provided will default to this if there are no results stored within Maropost Commerce Cloud for the requested content
`*header` HTML & b@se tags Renders a single usable space above the body
`*footer` HTML & b@se tags Renders a single usable space below the body

Available Options

The images with type:'logo', can be updated at Settings & tools > Logos.

type:'' id:'' thumb:'' Description
`adw` Campaign ID Advertising campaign banner
`brochure` SKU Returns the web address for the PDF Brochure on a product
`content` Content ID Main Image - content page (including product categories, brand, blog post and custom content types)
`content` Content ID `alt_1` Alt Image 1 - content page (including product categories, brand, blog post and custom content types)
`itemspecific` Specific ID Product specific image
`logo` `website` Website Logo
`logo` `checkout` Checkout Logo
`logo` `pdf` PDF Invoice Logo
`logo` `mobile` Mobile Shop Logo
`logo` `facebook` Facebook Logo
`logo` `ebay` eBay Logo
`logo` `favicon` Favicon
`product` SKU `full`, `thumbL`, `thumb` Main product image - full size, large thumbnail and thumbnail
`product` SKU `alt_#`, `alt_#_thumb` Alternate product images - full size and thumbnail. Replace `#` with the thumbnail number
`user` Customer username Customer logo

Was this article useful?

Be notified when this page is updated. Optional.