[ xmlSE . how to . create an index template ] edit
Index templates control the appearance of category index pages. When you create a new category, you also need to create an index template and create a record template for each browser version of your site.
Index templates use the tags described in 'edit an html template', as well as '<subcategory>...</subcategory>' and '<record>...</record>' tags to indicate which portion of the template should be repeated for each subcategory, and for each record.
Inside the '<subcategory>...</subcategory>' tags, you can use '<data field="subcategory" />' tags to get the name of the subcategory and '<if field="subcategory">...</if>' tags to only include a portion of the template when the subcategory has a name (the default subcategory contains all the records with a blank subcategory field and has no name). The contents of the subcategory tag will be repeated for each subcategory.
Inside the '<record>...</record>' tags you can use data and if tags to access the fields of each record. The contents of the record tag are repeated for each record in the category. When you edit a category, you can control which method is used to sort the records within a subcategory and also invert the order.
To allow people to create new records for this category, you need to include the new record link, '<a href="../../system/cgi-bin/new.cgi">new</a>'. The new record script will extract the category that the record is to be added to from the url of the page the link is on.
last updated 2.28.2002 by administrator