SEO-settings

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.

SEO-URL Templates

  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.

 

Product detail page

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.

  • A green tick means that the variables are correct.
  • A red X indicates that at least one variable cannot be resolved and you must adjust the entry to save the settings.


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

DescriptionVariable
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.


Category page

In the second field you can adjust the template for the category page (3). 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

DescriptionVariable
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 }}


Filtering

It is also possible to integrate filters into the SEO template. This for example allows, the entire URL to be written in lower case.
The filters are added with a "|" separated behind the variable within the {{}}.

For the lower case of the product name this would be possible e.g. as following

without filter

{{ product.translated.name }}/{{ product.productNumber }}

with filter


{{ product.translated.name|lower }}/{{ product.productNumber }}


With a FOR loop this is appended in the {{ part|lower }}. For category pages this looks like this

without filter


{% for part in category.seoBreadcrumb %}{{ part }}/{% endfor %}

with filter


{% for part in category.seoBreadcrumb %}{{ part|lower }}/{% endfor %}


In general you can use the available Twig filters. You can find more information on this in the Twig documentation under https://twig.symfony.com/doc/3.x/filters/index.html

Settings

Forwarding behaviour

Instead of redirecting Canonical URLs directly to the most recent URL using HTTP 301 (4), this function allows you to output an HTTP 301 redirect when URLs are changed. If the function is disabled, the browser will not display a note on the redirection.

Rebuild SEO index

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

Was this article helpful?