by Jim » Tue Mar 26, 2013 3:57 pm
Dividing items (page links or products) into different sections of a page would be done by having multiple [-- Loop Links --] or [-- Loop Products --] sections in the template. Typically this would be done by setting a VAR in the template and comparing that to one of the custom page/product fields of items assigned to the page. Only those items whose custom field contains the word would be inserted in the page.
There is probably some code in other forum posts that go into this in more depth but here is a section of a page template demonstrating the process. In this example I will use the extra page field 1 for the category.
[-- VAR.class "Product Categories" --]
put your section header here (i.e. [-- VAR.class --} would put Product Categories
[-- Loop Links --]
[-- Link --]
[-- End_loop Links --]
Put your divider bar here
[-- VAR.class "Parts Department" --]
put your section header here (i.e. [-- VAR.class --} would put Parts Department"
[-- Loop Links --]
[-- Link --]
[-- End_loop Links --]
In the[--DEFINE LINK_TO_PAGE--] section of the template you would have code something like this.
[-- IF VAR.class page.field1 --]
output your image and text for the page links
[-- END_IF --]
You can do as many sections as you need to. You might want to put a section with [-- VAR.class "" --] to catch any items that you might have forgotten to put a value in the page field1 text field. As I mentioned above this can also be done for products and even subproducts by using the appropriate values and template tags.