Locations module for PyroCMS 3 with dynamic field.
php artisan addon:publish locations
- Edit the
show
view 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
fields
and make a new field - In the
locations
section click onassignments
and 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_slug
and callrender()
on the locations. Or callrender()
onpage.your_slug
to 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 %}