# Additional fields
From version 3.5.0 it is possible to assign additional fields to the stores.
TIP
Additional fields are not automatically output in the template, but are available as Twig variables.
# Create additional fields
# Create set:
Create a set under Settings > System > Additional Fields. Assign this set to the StoreLocator entity:
# Create additional fields:
Define the field type and technical name
# Use additional fields
The fields now appear in the store and can be filled in.
# Output additional fields
In order to output the additional fields in the frontend, the template must be extended.
In this example, we extend the template of the detail page to include the output of the previously created field ("custom_storelocator_area").
WARNING
Do not overwrite the original template in the plugin - this will be overwritten with the next update.
- Create a "store_locator" directory in the existing theme in the "custom/plugins/YOURTHEME/src/Resources/views/storefront" directory.
- Copy the file detail.twig from "custom/plugins/NetiNextStoreLocator/src/Resources/views/storefront/" into the directory "store_locator" of your theme.
- Edit the file "custom/plugins/DEINTHEME/src/Resources/views/storefront/store_locator/detail.twig".
- Instead of overwriting the entire file, it makes sense to expand only certain blocks.
- Replacewith
{% sw_extends '@Storefront/store_locator/detail.twig' %}
{% sw_extends '@Storefront/storefront/store_locator/detail.twig' %}
- this expands the template
- Insertin a suitable block. The content is now output in the frontend.
{{ store.customFields.custom_storelocator_area }}
# Output all variables:
Add
{{ dump(page.store) }}
to the template to display all available variables.