Miva Merchant 4 Module FAQs » Category Page Templates (BROK_CTGYTEMPLATES)


{docurl}

Where Can I Find The Latest Tokens?

Here is a list of "Undocumented" tokens available for use in the Template modules:


Added 2003/08/25

  • %begin_trackinginventory%...%end_trackinginventory%
    (displays it's contents only if inventory tracking is enabled for that product)
  • %begin_nottrackinginventory%...%end_nottrackinginventory%
    (display it's contents only if inventory tracking is NOT enabled for that product).

Added 2003/07/17

  • %begin_ifloggedin%...%end_ifloggedin%
  • %begin_ifnotlogged%...%end_ifnotloggedin%
  • %noform%
    token for use in main template to suppress addition of form tags
  • %var|variable|%
    modified token to include ability to evalute expressions
  • added support for OUI tokens
  • %begin_if| and %
    begin_notif| modified to evaluate full Miva expressions
  • %oui_prodprice%
    token to display price as modified by OUI_display_price function
  • %begin_ouipricediscount%...%end_ouipricediscount%
    displays contents if
    %oui_prodprice% != %prodpriceF%
  • %begin_noouipricediscount%...%end_noouipricediscount%
    displays contents if
    %oui_prodprice% = %prodpriceF%
  • %hiddenqty|xxx|%
    added token to related products template
  • %oui_catimage1%, %oui_catimage2%, %oui_catimage3%
    tokens to display alternate category images

Added 2003/05/16

  • %begin_pricegroup%...%end_pricegroup%
    : displays its contents if the customer is in any price group
  • %begin_nopricegroup%...%end_nopricegroup%
    : displays its contents if the customer is not in any price group
  • %begin_availgroup%...%end_availgroup%
    : displays its contents if the customer is in any availability group
  • %begin_noavailgroup%...%end_noavailgroup%
    : displays its contents if the customer is NOT in any availability group
  • %begin_inpricegroup|group|%...%end_inpricegroup%
    : displays its contents if the customer is the in the price group with the name "group"
  • %begin_notinpricegroup|group|%...%end_notinpricegroup%
    : displays its contents if the customer is NOT the in the price group with the name "group"
  • %begin_inavailgroup|group|%...%end_inavailgroup%
    : displays its contents if the customer is the in the availability group with the name "group"
  • %begin_notinavailgroup|group|%...%end_notinavailgroup%
    : displays its contents if the customer is the in the availability group with the name "group"

Added 2003/05/13

  • %begin_hasimage%...%end_hasimage%
    displays contents if product image file exists
  • %begin_hasnoimage%...%end_hasnoimage%
    displays contents if product image file does not exist
  • %begin_hasthumbnail%...%end_hasthumbnail%
    displays contents if product thumbnail file exists
  • %begin_hasnothumbnail%...%end_hasnothumbnail%
    displays contents if product thumbnail file does not exist
  • %begin_nopricediscount%...%end_nopricediscount%
    displays contents if the list price is NOT lower than product price
  • %begin_nocostdiscount%...%end_nocostdiscount%
    displays contents if the price is NOT lower than the cost

Added 2003/05/02:

  • %begin_hasattributes%...%end_hasattributes%
    displays contents only if the product has attributes
  • %begin_hasnoattributes%...%end_hasnoattributes%
    displays contents only if the product has no attributes
  • %begin_if|variable|%....%end_if%
    tokens displays contents only if the variable evaluates to true
    example:
    %begin_if|Products.d.desc|%...%end_if%
    will display its contents only if the product does not have a description
  • %begin_notif|variable|%....%end_notif%
    tokens displays contents only if the variable evaluates to false

Added 2003/04/25:

  • %begin_hasproducts%...%end_hasproducts%
    displays contents only if the category has products
  • %begin_noproducts%...%end_noproducts%
    displays contents only if the category has noproducts
  • %begin_hassubcats%...%end_hassubcats%
    displays contents only if the category has sub-categories
  • %begin_hasnosubcats%...%end_hasnosubcats%
    displays contents only if the category does NOT have sub-categories.

Added/modified on 2003/04/04:
  • Added attribute specific length tokens (ie.
    %FieldsT|delimiter|token#|defaultsize:defaultmax|%
    )

You can now use the token

%fieldsT%
in the text type attribute fields. It lets you specify that the field length and maxlength is to be derived from the attribute code. This is done by specifying the delimiter which your code is separated into parts by and the # of the portion to use. For example, if your attribute code is of the form ATTRCODE-10-SMSTEEL1, then you can specify that the size (10) to use with the token:

%fieldsT|-|2|10:10|%
(where 10 is the default size:maxlength)

This would then cause the module to look at the attribute code to determine the length of the field. It would treat the - as a delimiter and select the second portion (10) and use that for length. Note that it is actually looking for that field to be in the form length:maxlength but if one or the other is not specified the default value is used (i.e. 10:10 in the above example).

So to specify a specific length and maxlength for the attribute, you could use an attribute code such as:

ATTRCODE-10:10-SMSTEEL1


Added support for OUI additional images. The width and height, if specified, will be used.

  • %ouiimage1%
  • %ouiimage2%
  • %ouiimage3%

Modified

%prodimage% and %prodthumb%
tokens to use oui height and width. If specified for the product image, they will be used to display them.


Added

%var|variable_name|%
token
You can use the token

%var|variable_name|%
to display any Miva variables. For example, to display the OUI thank you message, you could use the token:
%var|OUI_Store.d.thankyou|%


Added 3/12/2003

  • %totalproducts%
    token (total number of products in category)
  • %totalpages%
    token (total number of pages in category)

%begin_haspages%...%end_haspages%
: conditionally displays the text between them only if the category has more than one page of products. For example:
%begin_haspages% Pages:%paging%%end_haspages%
will display the paging only if there is more than one page of products.


%insert|file|length|%
: This token will import a file at the path "file" (relative to the Miva Data root) up to the "length". If the length is set to "full" (i.e.
%insert|file|full|%
) the token will insert the complete file. This token is processed first so the imported file can contain tokens which will be processed. The token itself cannot contain other tokens.


%insert2|file|length|%
: This token will import a file at the path "file" (relative to the Miva Data root) up to the "length". If the length is set to "full" (i.e.
%insert|file|full|%
) the token will insert the complete file. This token is processed last, so the import file cannot contains tokens to be processed (any tokens in the file will simply be passed through) but the token itself can contain tokens, such as:
%insert2|%prodcode%.html|full|%
.


  • %session_id%
    : The value of the g.Session_id variable
  • %sessionurl%
    : The value of the g.Sessionurl variable. On an non-secure page this is equal to Domain.d.mm_url. On a secure page it is equal to Domain.d.mm_url $ 'Session_ID=' $ g.Session_id $ '&'
  • %prodpriceU%
    : product price unadjusted for discounts
  • %prodpriceUF%
    : product price unadjusted and formatted
  • %discountsave%
    : dollar amount difference between adjusted, which accounts for discounts such as price groups, and un-adjusted
  • %discountsaveF%: same as %discountsaveF%
    but formatted
  • %discountprcnt%
    : the difference between adjusted and un-adjusted as a percentage of the unadjusted price.
  • %stockmessageS%
    : short stock message
  • %stockmessageL%
    : long stock message
  • %valuesave%
    : the dollar amount (product cost - product price)
  • %valuesaveF%: the formatted %valuesave%
  • %prcntsave%
    : percentage calculated as 100 x (product cost - product price)/product cost
  • %prodtoken|xx|%
    : if your product description is separated into sections by the pipe character, |, this will display the xxth section. In the description: a toy train|nice train, the text "a toy train" would be section 1 (
    %prodtoken|001|%
    )and "nice train" would be section two (
    %prodtoken|02|%
    ).
  • %prodtoken^|xx|%
    : if your product description is separated into sections by the carat character, ^, this will display the xxth section. In the description: a toy train^nice train, the text "a toy train" would be section 1 (
    %prodtoken^|001|%
    )and "nice train" would be section two (
    %prodtoken^|02|%
    ).
  • %proddesc|xxx|%
    : returns the first xxx characters of the product description (xxx has to be three digits, eg. 005 will return the first 5 characters). If the xxxth character is not a space (or tab) character, the string will be shortened until the last character is a space so that the displayed text will not end with a truncated word.
  • %cattitleimage%
    : the category title image
  • %cattitleimageL%
    : the category title image linked to the category
  • %ctgy_hdr%
    : the category header
  • %ctgy_ftr%
    : the category footer

The following conditional token pairs can be used:

  • %begin_instock%/%end_instock%
    :displays if the product is in stock (using Merchant Inventory feature)
  • %begin_outstock%/%end_outstock%
    :displays if out of stock
  • %begin_lowstock%/%end_lowstock%
    :displays if "low" stock
  • %begin_noweight%/%end_noweight%
    :displays if the product does not have a weight
  • %begin_hasweight%/%end_hasweight%
    :displays if the product does have a weight
  • %begin_inbasket%/%end_inbasket%
    :displays if the product is in the basket
  • %begin_notinbasket/%end_notinbasket%
    :displays if the product is NOT in the basket
  • %begin_zeroprice%/%end_zeroprice%
    :displays if the product has 0 price
  • %begin_hasprice%/%end_hasprice%
    :displays if the product has a price
  • %begin_pricediscount%/%end_pricediscount%
    :displays if the calculated price is lower than the product price
  • %begin_costdiscount%/%end_costdiscount%
    :displays if the product price is lower than the product cost

In each case, you include the %begin_ token before the html/tokens that you want to make conditional, and the %end_ token at the end. If the condition is met (eg. in stock, out of stock, low stock), then the html/tokens between the begin_ and end_ will be displayed. For example, to make the display of the add one button conditional on the product being in stock replace the

%prodaddone%
button with:

%begin_instock% %prodaddone% %end_instock%
.


Added the tokens

%begin_hasprice%...%end_hasprice%
and
%begin_zeroprice%...%end_zeroprice%
to the attribute templates. It can be used in the Radio attr. template, Radio option template, Select attr. template, Checkbox attr. template, Text attr. template, and Memo attr. template. The tokens are used exactly as the corresponding tokens for the product template area.


The

%paging%
token can be used in the main template area to display an "index" to category pages. For example, if your category has 6 pages of products and your customer is currently on page 3 the
%paging%
token would be replaced with something like:

1 2 [3] 4 5 6
with each number being a "quick link" to that page.


The Category Paging template for "this page" is the template used to replace the number that the customer is currently on. The token

%number%
is replaced with the page number, the token
%smallalpha%
is replaced with a lower case letter (i.e. the pages would be lettered a b c d e etc.), and the token
%largealpha%
is replaced with upper case letter (i.e. A B C D). So by default, this template has the text [
%number%
] in it and displays as in the above example.


The 'template for "other pages"' is similar and used to display the page "number" for pages the customer is NOT on (i.e. 1, 2, 4, 5, 6 in the above example).



Last update: 2007-04-26 13:50
Author: Support
Revision: 1.1

Print this record Send FAQ to a friend Show this as PDF file
Please rate this FAQ:

Average rating: 0 out of 5 (0 Votes )

completely useless 1 2 3 4 5 most valuable

You cannot comment on this entry

Records in this category