...
In this quick example, we will setup two basic templates (group and item), create the root group of the catalog, assign a view items to the group, and view the different pages.
First, you need to navigate to the template management section:
Panel |
---|
Login → Main Menu → Catalog → [choose a host] → Manage Catalog Templates |
1) Select "Catalog" on the left hand navigation. | 2) Click [choose this host]. | 3) Click "Manage Catalog Templates" under the Display section. |
In the rest of this guide, the click trail for navigation will simply be spelled out using arrows like it is at the top of this page.
Now, click on the [new] button at the top of the page and create the following template. For your convenience, the source to the template script is provided below so you can copy and paste it.
Name: template_group
Description: Hello World Group Template
Type: Group
Template Code:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Hello World!<br> You are currently at ${group.getPath()}<br> The following items are available:<br> #foreach ($item in $group.getItems()) <a href="${baseUrl}${group.getPath()}${item.getMerchantItemID()}.html"> ${item.getDescription()}</a><br> #end |
...
Name: template_item
Description: Hello World Item Template
Type: Item
Template:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Hello World!<br> <a href="${baseUrl}${group.getPath()}">Return to product group</a><br> <p> ${item.getDescription()}<br> ${item.getCost()}<br> <a href="${checkoutUrl}&ADD=${item.getMerchantItemID()}">Add to cart</a> |
...