https://github.com/wirelab-archive/locations-module
Locations module for PyroCMS 3
https://github.com/wirelab-archive/locations-module
locations mit-license php pyro pyrocms pyrocms-modules pyrocms3
Last synced: 6 months ago
JSON representation
Locations module for PyroCMS 3
- Host: GitHub
- URL: https://github.com/wirelab-archive/locations-module
- Owner: Wirelab-archive
- License: mit
- Archived: true
- Created: 2017-03-20T09:16:21.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2021-02-10T15:10:26.000Z (over 5 years ago)
- Last Synced: 2025-07-30T17:25:31.255Z (10 months ago)
- Topics: locations, mit-license, php, pyro, pyrocms, pyrocms-modules, pyrocms3
- Language: PHP
- Size: 33.2 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Locations module
## ⚠️ This repository has been deprecated ⚠️
Locations module for PyroCMS 3 with dynamic field.
## Overwriting the default view
### The prefered / project specific way
1. `php artisan addon:publish locations`
2. Edit the `show` view in `resources//addons/wirelab/locations-module/views/location`
### In a custom theme
In your theme's service provider add the following:
```php
protected $overrides = [
'wirelab.module.locations::locations/view' => 'your view path here',
];
```
## Adding fields to a location
1. In the location module go to `fields` and make a new field
2. In the `locations` section click on `assignments` and assign the field
## Adding locations to a page
1. Create a _multiple_ field in the pages module, assign it to Locations > Locations
2. Assign the field to a page type
3. In the page type loop over `page.your_slug` and call `render()` on the locations. Or call `render()` on `page.your_slug` to have it to loop for you.
Examples:
```twig
page.your_slug.render()
```
```twig
{% for location in page.your_slug %}
location.render()
{% endfor %}
```
Not calling render will return the attributes of the location.
```twig
{% for location in page.your_slug %}
{{ location.name }}
{{ location.email }}
{% endfor %}
```