-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vendor module and front end module support (#174)
* vendor module * shifted more stuff around * Started to shift things around to prep for front end modules * Converted all string class refrences to static::class Started to create tests for new methods * Re-arranged tests Added more tests to LocatorTest.php - split LocatorTest.php into locator and controller tests respectivly * Fixed scrutinizer * Added more tests * Added another test * Made locator less of a priority for templates - front end modules now get to be first * moved the loading of google maps outside of trigger check * Now uses config values to get variable names - Allows to change `Controller::curr()->getRequest()->getVar('Radius')` to `Controller::curr()->getRequest()->getVar('radius')` - same with category * Updated docs
- Loading branch information
Showing
26 changed files
with
586 additions
and
231 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## Customizing | ||
Some customization is done through a yml config. | ||
|
||
### Limit | ||
Will limit the amount of locations that can be shown at one time. Set to `-1` to have no limit. Having no limit can result in slow load times, or even timeouts when loading the page or new data. | ||
```yaml | ||
Dynamic\Locator\Locator: | ||
limit: 50 | ||
``` | ||
### Radius | ||
- `show_radius` will determine if a radius dropdown should be shown. | ||
- `radii` is a list of radii to use in the radius dropdown. | ||
```yaml | ||
Dynamic\Locator\Locator: | ||
show_radius: true | ||
radii: [30, 50, 100] | ||
``` | ||
|
||
### Templates | ||
Overriding the templates for the info window and list can be overridden by using `infoWindowTemplate` and `listTemplate`. | ||
- `infoWindowTemplate` is the popup when a location is clicked. | ||
- `listTemplate` is a single location in the list | ||
```yaml | ||
Dynamic\Locator\Locator: | ||
infoWindowTemplate: 'dynamic/silverstripe-locator: client/infowindow-description.html' | ||
listTemplate: 'dynamic/silverstripe-locator: client/location-list-description.html' | ||
``` | ||
The `vendor/module: file` pattern can be used to locate files. | ||
|
||
### Custom URL Variables | ||
Sometimes it is useful to override the defaults for url variables. | ||
An example of this is when the module uses title case but you wrote everything for lowercase. It becomes seamless to switch out the variable names. | ||
- `radius_var` is the variable used to send and receive the currently selected radius. | ||
- `category_var` is the variable used to send and receive the currently selected category. | ||
- `address_var` is the variable used to send and receive the searched location. | ||
- `unit_var` is the variable used to send and receive the current unit of measure used for distance. | ||
```yaml | ||
Dynamic\Locator\Locator: | ||
radius_var: 'Radius' | ||
category_var: 'CategoryID' | ||
Dynamic\SilverStripeGeocoder\DistanceDataExtension: | ||
address_var: 'Address' | ||
unit_var: 'Unit' | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Setup | ||
To use google maps an api key is required. | ||
In mysite/_config/settings.yml | ||
```yaml | ||
Dynamic\SilverStripeGeocoder\GoogleGeocoder: | ||
geocoder_api_key: YOUR_API_KEY | ||
``` | ||
Replace `YOUR_API_KEY` with your google maps api key. If you are unsure where to get an api key, [look here](https://developers.google.com/maps/documentation/javascript/get-api-key). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,12 @@ | ||
#SilverStripe Locator | ||
# SilverStripe Locator | ||
|
||
##Using Locator | ||
## Using Locator | ||
|
||
See [User Guide](userguide/index.md) for information on using the Locator module in the CMS. | ||
|
||
See [Importing Locations](userguide/import.md) for information on importing Location and Category records. | ||
See [Importing Locations](userguide/import.md) for information on importing Location and Category records. | ||
|
||
## Developer guides | ||
|
||
- [Setup](developerguide/setup.md) | ||
- [Customizing](developerguide/customizing.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.