Product pages and addresses
All product details live under one page of the type Consho product page. The address pattern decides which address a product gets there.
Setting it up
In the site structure, create a page of the type “Consho product page” and put the Product detail element on it. It shows images, price, variants, warnings and manufacturer details; any other content may stand beside it. If someone calls the page without a product, it answers with 404.
The address pattern
The Address pattern field on the product page describes what comes after the page. Available are {alias}, {sku}, {manufacturer} and {type}; {alias} must appear, as only the alias is unique per product. {sku} may appear as well, e.g. {sku}/{alias}. A category deliberately has no place in the address. The “Route path” shows the result for checking.
A changed pattern changes the address of every product. Consho redirects the old addresses (see below) – still, better decide once and stick with it.
Redirects
If a product address changes – through the pattern, the alias, the SKU, the manufacturer or the product type –, Consho remembers the old one. Anyone calling it is sent to the new address with 301. If the product has been deleted or is invisible, it stays a 404. consho:url:prune clears out old entries.
Variants, canonical, title
- A variant is chosen with
?variant=<ID>, not through a path of its own. - The canonical address is always the product address without a variant.
- Title and description come from the main product: the meta description, otherwise the short description shortened to 160 characters, otherwise the description of the page.
Findings and pitfalls
- Product page in first place below the start point: Contao forwards the start point there, and without a product that is an error. Put another page in first place.
- Invalid address pattern, saved past the back end: Consho falls back to
{alias}. Save the page settings again.