~PR-Name~ is replaced with the product name of the currently selected product.
To display all products in the shop with a single template, for instance, we do not include the explicit product properties in the template — instead we use a placeholder in that spot: a WEBSALE tag. For every product property and other values to be replaced, such as company name or category name, there is a dedicated tag. This way, you don’t have to create a separate template for every product, and any changes don’t need to be made on each individual product template.
WEBSALE distinguishes the following types of tags:
- Single tag:
~Tag~ - Range tag:
{Tag}.........{/Tag} - Negative range tag:
{!Tag}.........{/!Tag} - Loop tag:
{@Tag}.........{/@Tag}
Single tag: ~Tag~
A single tag is replaced with a value. That is, the contained value is output.
Example: ~PR-Name~ is replaced with the product name.
Range tag: {Tag}.........{/Tag}
A range tag brackets a template section that WEBSALE V8s shows or hides depending on whether the tag of the same name contains a value or not.
Example: while most WEBSALE V8s tags are fixed, you can, for instance, define product-related tags yourself as needed. If a freely defined field Akku contains any value, for example 500, everything between the brackets {PR-Akku}...{/PR-Akku} is shown. This can be, for example, an HTML table row containing fixed text.
That text is only displayed when a value has been entered in the corresponding field of the product. As a rule, the tag for the associated field (in the example ~Akku~; the shop software turns this tag into ~PR-Akku~ when used on a product page) is used within the range tags. For example, {PR-Akku} Battery life: ~PR-Akku~ mAh {/PR-Akku} results in the display “Battery life: 500 mAh”.
Negative range tag: {!Tag}.........{/!Tag}
A negative range tag has the reverse logic of a range tag. If a parameter has no value, the negative range is shown.
Example: if a freely defined field Akku contains no value, everything between the brackets {!PR-Akku}...{/!PR-Akku} is shown. This can be, for example, a table row containing the static text “Device without battery”. This text is then only displayed if the corresponding product field contains no value. For example, {!PR-Akku} Device without battery {/!PR-Akku} results in the display “Device without battery” when no value has been entered for the product’s Akku field.
Loop tag: {@Tag}.........{/@Tag}
In many situations, sections of a template need to be run through multiple times, for example to list all products of a category or all subcategories of a category. For this purpose, WEBSALE V8s provides a special form of range tags, the so-called “loop tags”. Loop tags are marked with a leading at sign (”@”), for example @PR-Data.
When you use a loop tag, the section is repeated as many times as the element referenced by the tag exists in the shop (quantity loop), and all data of the element is output on each iteration. WEBSALE V8s therefore performs automatic loop control by default. The designer does not have to worry about how many loop iterations are required to display all elements of a type or a set sequentially on a template.
Example: to display a list containing the product data of all products of a currently selected category, you define a loop {@PR-Data} within the range for the category {CAT-Data}. The number of loop iterations is determined automatically by the number of products available in this category:
PR-Data), WEBSALE V8s provides special DC-Loop tags that designers can use to create their own counting loops to control processes individually.
Tag-in-tag
With some tags it is possible to also use a further tag inside the argument. If you use any single tag inside the argument of a tag, you must replace the normal tag delimiters (tilde characters) with dollar signs. Example: a calculation is to be performed based on the product price. The tagDC-CommercialCalc1_set() is tag-in-tag capable. That is, a tag can be used as its argument — in this case the tag for the product price (PR-Price).
