In this how-to you will learn how to add your own templates for categories and products.
The content of products and categories are rendered by templates. LFS ships with several default templates and you can add your own.
All registered templates for categories can be selected within the View tab of the Category Management Interface. All registered templates for products can be selected within the Data tab of the Product Management interface.
Please refer to the default templates in order to find out which information are provided within the templates. You can also add your customer template tags in order to provide more functionality.
In order to add a new template for categories go to lfs.catalog.settings and add tuple to CATEGORY_TEMPLATES.
(0,{"file":"%s/%s" % (CAT_PRODUCT_PATH ,"default.html"),
"image":IMAGES_PATH + " /product_default.png",
"name" : _(u"Category with products"),
}),
Which means:
(1,{"file": "%s/%s" % (CAT_CATEGORY_PATH ,"default.html"),
"image": IMAGES_PATH + "/category_square.png",
"name": _(u"Category with subcategories"),
}),
Which means:
In order to add a new template for products go to lfs.catalog.settings and add tuple to PRODUCT_TEMPLATES.
(0, {"file" : "%s/%s" % (PRODUCT_PATH, "product_inline.html"),
"image" : IMAGES_PATH + "/product_default.png",
"name" : _(u"Default template")
},),
Which means: