Locations module for PyroCMS 3 with dynamic field.
php artisan addon:publish locations- Edit the
showview inresources/<site name>/addons/wirelab/locations-module/views/location
In your theme's service provider add the following:
protected $overrides = [
'wirelab.module.locations::locations/view' => 'your view path here',
];- In the location module go to
fieldsand make a new field - In the
locationssection click onassignmentsand assign the field
- Create a multiple field in the pages module, assign it to Locations > Locations
- Assign the field to a page type
- In the page type loop over
page.your_slugand callrender()on the locations. Or callrender()onpage.your_slugto have it to loop for you. Examples:
page.your_slug.render(){% for location in page.your_slug %}
location.render()
{% endfor %}Not calling render will return the attributes of the location.
{% for location in page.your_slug %}
{{ location.name }}
{{ location.email }}
{% endfor %}