How To

Advanced Template Tags

Template Tags are values that will substitute other information in their stead. What information is substituted depends entirely on how the template tag was created. All ChannelAdvisor Template Tags are enclosed in double brackets, e.g. {{TEMPLATETAGNAME}}. This page discusses some advanced uses of template tags

 

Prerequisites


You should be familiar with the following topic:

 

Tasks to Complete


Below are steps to create a few advanced template tags.

 

Referencing Template Tags Within Template Tags

For more advanced users, you can actually reference Template Tags from within Template Tags.

For instance, you could create a Template Tag named "PriceComparison" with the following description:

<table border="0"><tr><td>Amazon Price:</td><td>{{AMAZONPRICE}}</td></tr><tr><td>eBay Price:</td><td>{{ITEMBINPRICE}}</td></tr>

Then, when you use the {{PRICECOMPARISON}} Template Tag, not only will the above HTML be input, but the Template Tags within the HTML will be input as well.

Note: This process is called "nesting", and our system has a cutoff at 3 nests. You can have a Template Tag in a Template Tag in a Template Tag, but any further nesting will result either in an error or the Template Tag being displayed as text instead of the information it represents.

 

Mathematical Calculations Using Template Tags:

You can perform mathematical calculations on Template Tags that are used in the eBay Posting Template tool to achieve a particular posting strategy. Here is the format to use to apply mathematical equations to a tag:

{{{TagName, Action, Amount}}}

If an invalid action or amount is used, the tag will be returned without any modification applied. Reference the tag calculation table below for a full list of all functions that can be done using tags.

Below are some examples:

  • Calculate a percentage of Starting Price template tag – Placing the following equation in the 'Minimum Bid' field would post an item using a value that is 90% of the Starting Price value listed in the inventory item record:

    {{{ITEMSTARTINGPRICE, %, 90}}}

    {{{ITEMSTARTINGPRICE,*, .9}}}
    can also be used to reach this same calculation.
     
  • Calculate  a price greater/less than the inventory item pricing – 

    {{{ITEMBINPRICE,-,10}}}  Placing this equation in the Buy-It-Now (BIN) field would post an item using a value that is $10 less than the BIN value listed in the inventory item record.

    {{{ITEMBINPRICE,+,10}}}  Placing this equation in the Buy-It-Now (BIN) field would post an item using a value that is $10 more than the BIN value listed in the inventory item record.
     
  • Calculate the MOD of a Starting Price template tag:
    • If starting price is 26, {{{ITEMSTARTINGPRICE, MOD, 5}}}   returns a value of $1.00
    • If starting price is 25, {{{ITEMSTARTINGPRICE, MOD, 5}} }  returns a value of $0.00
    • If starting price is 24, {{{ITEMSTARTINGPRICE, MOD, 5}}}   returns a value of $4.00
       
  • Calculate the DIV of a Starting Price template tag:
    • If starting price is 26, {{{ITEMSTARTINGPRICE, DIV, 5}}}   returns a value of $5.00
    • If starting price is 25, {{{ITEMSTARTINGPRICE, DIV, 5}}}   returns a value of $5.00
    • If starting price is 24, {{{ITEMSTARTINGPRICE, DIV, 5}}}   returns a value of $4.00

 

Reference


You can perform the following calculations using tags:

Calculation Description
+Perform an addition of the value in Amount to the Value represented by the tag.
-Perform a subtraction of the value in Amount from the value represented by the tag.
*Perform a multiplication of the value in Amount with the value represented by the tag.
/Perform a division of the value represented by the tag by the value in Amount.
%Calculate the Amount percentage of the value represented by the tag.
MODThis operator divides two numbers and returns the remainder. For example, dividing 5 into 26 returns a remainder of 1.
DIVThis operator divides one number by another number and returns the integer part of the result. For example, dividing 5 into 26 returns a value of 5.
LeftAllows the user to select the first 'X' number of characters from the left end of a character string. These equations are best used in the Description Template design.
RightAllows the user to select the first 'X' number of characters from the right end of a character string. These equations are best used in the Description Template design.

 

Template Tags are values that will substitute other information in their stead. What information is substituted depends entirely on how the template tag was created. All ChannelAdvisor Template Tags are enclosed in double brackets, e.g. {{TEMPLATETAGNAME}}. This page discusses some advanced uses of template tags

 

Prerequisites


You should be familiar with the following topic:

 

Tasks to Complete


Below are steps to create a few advanced template tags.

 

Referencing Template Tags Within Template Tags

For more advanced users, you can actually reference Template Tags from within Template Tags.

For instance, you could create a Template Tag named "PriceComparison" with the following description:

<table border="0"><tr><td>Amazon Price:</td><td>{{AMAZONPRICE}}</td></tr><tr><td>eBay Price:</td><td>{{ITEMBINPRICE}}</td></tr>

Then, when you use the {{PRICECOMPARISON}} Template Tag, not only will the above HTML be input, but the Template Tags within the HTML will be input as well.

Note: This process is called "nesting", and our system has a cutoff at 3 nests. You can have a Template Tag in a Template Tag in a Template Tag, but any further nesting will result either in an error or the Template Tag being displayed as text instead of the information it represents.

 

Mathematical Calculations Using Template Tags:

You can perform mathematical calculations on Template Tags that are used in the eBay Posting Template tool to achieve a particular posting strategy. Here is the format to use to apply mathematical equations to a tag:

{{{TagName, Action, Amount}}}

If an invalid action or amount is used, the tag will be returned without any modification applied. Reference the tag calculation table below for a full list of all functions that can be done using tags.

Below are some examples:

  • Calculate a percentage of Starting Price template tag – Placing the following equation in the 'Minimum Bid' field would post an item using a value that is 90% of the Starting Price value listed in the inventory item record:

    {{{ITEMSTARTINGPRICE, %, 90}}}

    {{{ITEMSTARTINGPRICE,*, .9}}}
    can also be used to reach this same calculation.
     
  • Calculate  a price greater/less than the inventory item pricing – 

    {{{ITEMBINPRICE,-,10}}}  Placing this equation in the Buy-It-Now (BIN) field would post an item using a value that is $10 less than the BIN value listed in the inventory item record.

    {{{ITEMBINPRICE,+,10}}}  Placing this equation in the Buy-It-Now (BIN) field would post an item using a value that is $10 more than the BIN value listed in the inventory item record.
     
  • Calculate the MOD of a Starting Price template tag:
    • If starting price is 26, {{{ITEMSTARTINGPRICE, MOD, 5}}}   returns a value of $1.00
    • If starting price is 25, {{{ITEMSTARTINGPRICE, MOD, 5}} }  returns a value of $0.00
    • If starting price is 24, {{{ITEMSTARTINGPRICE, MOD, 5}}}   returns a value of $4.00
       
  • Calculate the DIV of a Starting Price template tag:
    • If starting price is 26, {{{ITEMSTARTINGPRICE, DIV, 5}}}   returns a value of $5.00
    • If starting price is 25, {{{ITEMSTARTINGPRICE, DIV, 5}}}   returns a value of $5.00
    • If starting price is 24, {{{ITEMSTARTINGPRICE, DIV, 5}}}   returns a value of $4.00

 

Reference


You can perform the following calculations using tags:

Calculation Description
+Perform an addition of the value in Amount to the Value represented by the tag.
-Perform a subtraction of the value in Amount from the value represented by the tag.
*Perform a multiplication of the value in Amount with the value represented by the tag.
/Perform a division of the value represented by the tag by the value in Amount.
%Calculate the Amount percentage of the value represented by the tag.
MODThis operator divides two numbers and returns the remainder. For example, dividing 5 into 26 returns a remainder of 1.
DIVThis operator divides one number by another number and returns the integer part of the result. For example, dividing 5 into 26 returns a value of 5.
LeftAllows the user to select the first 'X' number of characters from the left end of a character string. These equations are best used in the Description Template design.
RightAllows the user to select the first 'X' number of characters from the right end of a character string. These equations are best used in the Description Template design.

 

0
Your rating: None Average: 3 (2 votes)
0
Your rating: None Average: 3 (2 votes)
Tags