Shopp Support Forum

Full Version: What are the options for options
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
When using shopp() tags with dot notation, the options are the second argument

Code:
shopp('Object.property', 'options');

otherwise it will be the third argument

Code:
shopp('Object', 'property', 'options');


Options come in pairs

There is a name and a value for every option, for example
Code:
shopp('product.coverimage', 'alt=My Image' );

In this case, the name of the option is 'alt', the value is 'My Image'.


Multiple options

Most shopp() tags have multiple options you can set. To combine options you use the &-sign.
Code:
shopp('product.coverimage', 'alt=My Image&size=300' );

All the option name-value pairs combined, are within one pair of single quotes, no matter how many options you set.


Using variables in options

To make options even more flexible, you can also use variables to set the value.
Code:
$size = 300;
shopp('product.coverimage', "alt=My Image&size=$size" );

Pay attention to the quotes, when you use variables you need to use double quotes.