This documentation is for a version that has reached its End Of Life. Such versions are no longer supported and don't receive security updates. Consider updating to a newer version.
Catalog templates¶
Template list¶
The following templates are used to render the catalog and its parts:
SilversolutionsEshopBundle:Catalog:catalog.html.twig- whole catalogcatalog/product.html.twig- individual productSilversolutionsEshopBundle:Catalog:productType.html.twig- product typeSilversolutionsEshopBundle:Catalog:Subrequests/listChildren.html.twig- product categories
The templates have access to the catalog node provided by the controller.
To show all the available attributes, use getAttributeNames(): {{ catalogElement.attributeNames|json_encode }}.
Product categories¶
You can use different layouts to display a product category page:
1 | |
Available options:
product_list: display product list directlyboth: display subcategories and product list, including an option to display facets in the left sidebar instead of the navigationcategories: display only subcategories. For the last category only, if there are no subcategories, display the product list
Configuration for templates¶
The configuration for choosing templates is stored in silver.eshop.yml:
1 2 3 4 5 | |
Rendering configuration¶
You can define the number of products and other settings for catalog rendering in the configuration:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | |
Catalog URLs¶
URLs are provided by special methods:
- SEO URL:
{{ catalogElement.seoUrl }} - permanent URL:
{{ catalogElement.permanentUrl }}
Since these URLs contain the prefix defined in the routing table as well, the path() function of Twig cannot be used.