To ease translating and changing text in templates Shopware uses snippets, which are called on by Smarty-variables in the template. So changes at the text don't consist of changes in the template.
The modul to manage snippets is found under "Settings > Snippets". Opening the module displays every snippet available in all shops. To find the needed snippet, you can either use the navigation on the left side, filter by main- and subshop, empty snippets or search for their content.
After you found the correct snippet, you can alter it using the editing symbol. The choosen snippet will be highlighted and you are able to change it's content. After changing it, the update-button saves the snippet. For the changes to be visible in the storefront it is necessary to clear "Configuration + template-Cache".
Expert-Mode provides the option to delete single snippets. Also it is possible to change the Namespace ( the smarty variable). This should be used with caution, as texts in the storefront might not be displayed correct or at all after deleting a snippet or changing it's Namespace
Note: Never change the name or namespace of default snippets. This results in losing links to the template and possible template errors. Further possible errors could be crawling-errors by bots.
To create a new snippet, click on the button Add snippet (1). A new window appears in which you can enter the data for the snippet.
The following data are required for the creation of the snippet
You are provided with the possibility to import new snippets or to alter existing snippets via an import. This can be done using a CSV-file. The folowing fields are necessary:
Fieldname | Explanation |
---|---|
namespace | Name of the controller |
name | Name of the variable |
value-de_DE-1 | German Content |
value-en_GB-1 | English Content |
Missing snippets will be created, existing will be updated.
Before modifying snippets make sure to create a database backup! By default, you should always save the database table s_core_snippets. Third party plugins may use other tables.
Naturally it is possible to export existing snippets in various filetypes. Available for this operation are CSV (MS), CSV (delimiter) and SQL (Backup). The last one can be used to reset the snippets via SQL-statement.
If the snippets aren't displayed correctly anymore, it is possible to recreate the snippets as before the import. For this you open the SQL-file exported prior to the import and copy the SQL-statements out of the document. After this you need to open the database and insert the dump via the SQL-field. After these changes the old snippets should be there again.