You are currently viewing the article on an older Shopware version!
In the SEO settings you can define the structure for the SEO URLs of the product detail pages and categories. For this purpose you have a variety of variables at your disposal.
With the item Sales channel (1) you can determine whether you want to configure the configuration globally for all sales channels or only for a selected sales channel.
If you have selected a specific sales channel and want to go back to the general setting, just click into the selection field and delete the content. Afterwards "All sales channels" will be displayed again.
In the first line you can specify the template for the URL of the product detail page (2). Note that the variables must be specified in Twig format. The structure here is as follows:
{{ product.name }}
Next to the field, a symbol shows you whether the variables stored in the SEO template are valid.
To the right of the field for the SEO-URL template you can choose from several variables. These are automatically added to the back of the SEO-template by clicking on the variable.
It should be noted, that the variables can be multi-level and that these are not added completely. This requires a subsequent manual adjustment in the SEO template field. You can find the complete variables in the list below.
An example of a variable that is incomplete is
{{ product.translated.name }}
In the selection on the right side the variable
{{ product.translated }}
is displayed. However, this is a "multi-level" variable and requires the complete specification of the further level. Here it is therefore necessary to add this manually.
.name
Examples of article variables
Description | Variable |
---|---|
Order number | {{ product.productNumber }} |
ID | {{ product.id }} |
Name | {{ product.name }} |
EAN | {{ product.ean }} |
Manufacturer name | {{ product.manufacturer.name }} |
Publication date | {{ product.releaseDate }} |
Meta Title | {{ product.metaTitle }} |
Description | {{ product.description }} |
Keywords | {{ product.keywords }} |
Breadcrumb | {% for part in product.mainCategory.breadcrumb %}{{ part }}/{% endfor %} |
There are generally more variables available. However, since these provide content that leads to regular changes in the URL and this has a negative influence on the ranking, we will not go into this further here.
In the second field you can adjust the template for the category page (2). The default category structure (the so-called breadcrumb) is used here. If you want to adjust the template for the categories, you can use the following variables
Examples of category variables
Description | Variable |
---|---|
Breadcrumb | {% for part in category.seoBreadcrumb %}{{ part }}/{% endfor %} |
ID | {{ category.id }} |
Name | {{ category.name }} |
Meta-Title | {{ category.metaTitle }} |
Description | {{ category.description }} |
Meta-description | {{ category.metaDescription }} |
After you have made changes to the SEO template, it is necessary to rebuild the index so that the URLs are updated.
You can do this from the console using the command
php bin/console dal:refresh:index