Using Template Tags
From Shopp Documentation
Shopp theme templates use Shopp template tags to access Shopp-related data and handle ecommerce interactivity such as the shopping cart, "Add to Cart" buttons or the checkout form, for example. Template tags look like this:
<?php shopp('catalog','breadcrumb'); ?>
Contents |
Anatomy of a Template Tag
The example template tag above will show a breadcrumb navigation element that includes links to any parent categories available when on any particular Shopp-driven page. This is a good example because it shows the two primary elements of a shopp() tag. As you see in the example, we tell Shopp what information we want from it by including parameters separated by commas (,). Additionally, parameters are always surrounded by quotes. You can use either single-quotes (') or double-qouotes (") around parameters (just make sure you don't forget them).
Object Parameter
Back to the example, above, the first parameter is the object we want to get information from, in this case the 'catalog'. The shopp() tags are often referred to by their object parameter (e.g. Catalog Tags or Cart Tags). The template tag reference for all of the shopp() tags is on the main Template API reference page and is organized by these objects.
Property Parameter
The second parameter is what information we want to get from the object, in this case the 'breadcrumb' navigation list. Each template tag reference page lists each of the object-specific template tags available.
Options Parameter
There is a third parameter not being used in the example above. The third parameter is for any options that you want to set that can alter the default behavior of a specific tag. With the breadcrumb tag, we might want to change the default separator that is shown between each category link from the default '»' to '>'. To do that, you would use an option parameter:
<?php shopp('catalog','breadcrumb','separator=>'); ?>
Some tags support multiple options. Similar to WordPress template tags, shopp() tag options are written in a URL query string format:
- option1=value&option2=value&option3=value…
For details on shopp() tag options, refer to the specific tag's documentation available from the main Customization reference page.
