This guide covers basic changes to SOTESHOP 8 themes: editing CSS, modifying HTML templates and adding content that can be edited in the administration panel. You will need a basic knowledge of HTML and CSS, a text editor and access to the store files.
Before editing files, check the options available under Theme editing in the administration panel. You can change the logo, colours, text and many layout settings without editing templates. The available options depend on the selected theme.
Create a custom theme based on your chosen theme. In the examples, its name is mytheme. Replace this with the directory name of your own theme. Back up the files before editing them; test larger changes on a test copy of the store first.
The base theme for SOTESHOP 8 is bianco. It inherits some templates from responsive, which contains the complete set of templates. Individual themes may inherit through several parent themes, for example:
mytheme → argento8 → bianco → responsive
When looking for a file to modify, check your own theme first, followed by each of its parent themes in order. Copy the first version you find to the corresponding directory in your own theme. Do not skip the other parents and go straight to responsive.
image_path function looks for an image in your theme first, then in each parent theme in order.Do not modify standard theme files or the store’s PHP code when changing the appearance. Your copy of an HTML template also overrides future fixes to the base template, so compare your modified templates with the latest base versions after updates.
Template paths beginning with /apps/ and /plugins/ are relative to the store’s application directory, which contains the symfony file. These are not URLs to open in a browser.
The /css/, /images/ and /js/ URLs are public asset paths. In the store’s development directory structure, they correspond to web/css/, web/images/ and web/js/. For example, the URL /css/frontend/theme/mytheme/mytheme.css corresponds to the file web/css/frontend/theme/mytheme/mytheme.css.
| Element | Path relative to the application directory |
|---|---|
| HTML document | /apps/ |
| Header | /apps/ |
| Footer | /apps/ |
| One-column or two-column layout | /apps//apps/ |
| Home page | /apps//apps/ |
| Product groups on the home page | /apps//apps//apps/ |
| Blog on the home page | /plugins/ |
| SEO text | /apps/ |
| Product list | /apps//apps/ |
| Product page | /apps/ |
| Information page | /plugins/ |
| Category menu | /plugins/ |
| Social media links | /plugins/ |
| Home page text | /apps/ |
| Theme fonts and scripts | /apps//apps/ |
The files listed in the table do not have to exist in your theme: the store uses their parent versions if they are missing. The home page may combine homepage.html, main_index.html and the components they call. Before changing the HTML, check the home page layout and section settings in the administration panel.
/css/frontend/theme/mytheme/mytheme.css.To give the buttons in your theme rounded corners, add:
/* Buttons */
.btn {
border-radius: 8px;
}
Check selectors using your browser’s developer tools. SOTESHOP 8 themes use Bootstrap 3. Use classes compatible with the version included in your store.
We will add an information bar above the header. The store owner will be able to change its text later in the administration panel without editing HTML.
https://adres-sklepu/backend_dev.php/theme/edit/id/ID_TEMATU. Replace the domain with your store’s address and ID_TEMATU with the ID shown in the theme editing URL.Complete the fields:
pasek-informacyjny - the identifier used in the template.The text belongs to a specific theme. Add it to the custom theme in which it should appear. Text entries are not automatically retrieved from parent themes. The Id must match in the administration panel and the template, and must be unique within that theme.
_header.html in each parent theme in order. For example, if it is not present in argento8, check bianco./apps/frontend/templates/theme/mytheme/_header.html. If you already have your own version, edit that file.Add the following before the existing header HTML:
<div class="theme-info-bar">
<div class="container">
{theme_content id='pasek-informacyjny'}
</div>
</div>
Add the following to your stylesheet at /css/frontend/theme/mytheme/mytheme.css:
/* Information bar */
.theme-info-bar {
padding: 8px 0;
background: #ececec;
color: #333;
text-align: center;
font-size: 1rem;
}
The developer backend is used here to add the text entry and assign its identifier. Subsequent content changes do not require backend_dev.php.
Add your custom styles to /css/frontend/theme/mytheme/mytheme.css. Do not copy entire parent stylesheets. Files in the _editor directory are generated by the theme configuration; change the appearance through the administration panel or your theme’s stylesheet.
Place theme images in the directory corresponding to the URL /images/frontend/theme/mytheme/, for example phone.png. Use the following in the template:
<img src="{image_path image='phone.png'}" width="14" height="14" alt="" />
The function supports inheritance. Adding an image with the same name to your theme overrides the parent image. An icon accompanying text can have an empty alt attribute; an image that conveys information should have a description.
{include_file id="_footer"}
Includes _footer.html with support for theme inheritance. A component retrieves data and displays it using its own template, for example:
{st_get_component module="stProduct" component="productGroup" product_group="MAIN_PAGE"}
Displays the product group with the symbol MAIN_PAGE. The group must be created and populated with products in the administration panel.
Create an information box in the administration panel and set its webmaster identifier to moj_boks. Add the following at the desired location in the template:
{st_get_component module="stBoxFrontend" component="boxSingle" params="webmaster_id=moj_boks"}
A content box is useful for longer content. Short messages and headings can be created as theme text entries.
Variables available in the product page template include {$name} - name, {$code} - code, {$description} - short description and {$description_long} - full description. Available variables depend on the view; check their usage in the current base template. Moving a variable to another file does not ensure that its data will be passed to that file.
Preserve existing conditions for displaying prices, availability and product options. Use the translation mechanism for fixed labels in templates, for example {__ text="Szukaj" langCatalogue="stSearchFrontend"}. You can find the langCatalogue value in the administration panel under Language definitions, in the Catalogue column for the relevant phrase. Content that the store owner needs to edit should be managed in the administration panel.
Include theme scripts in _script_theme.html. If you need to modify it, copy the version from the nearest parent and preserve the existing scripts. Save larger scripts as separate files, for example at the public URL /js/mytheme.js, and add the following to _script_theme.html:
{use_javascript src="mytheme.js"}
The JS directory is shared by the store, so use a unique file name. The _fonts.html file includes fonts and calls _script_theme.html; preserve that call. Host fonts locally, using the store’s existing resources where possible.
Wrap JavaScript or CSS containing braces and embedded in HTML in a {literal}…{/literal} block so that Smarty does not interpret it as template instructions. Keep Smarty calls, such as {theme_content id='pasek-informacyjny'}, outside that block.
Create the file /apps/backend/modules/stProductGroup/config/user_product_group.yml. If it already exists, extend its product_group section, preserving the existing entries. For example:
product_group:
MY: My group
SEASON: Seasonal offer
Use spaces for indentation in YAML. These entries make new types available for selection in the administration panel; they do not automatically create groups or add products. Create a group in the administration panel, select its type and assign products. Then call it in the template:
{st_get_component module="stProduct" component="productGroup" product_group="SEASON"}
This configuration file is shared by the store and is not limited to a single theme.
When finished, check the modified views on a computer and a phone, including in the store’s normal mode. When changing shared elements, check the home page, product list, product page and shopping cart.