dynamic / silverstripe-locator

SilverStripe Locator Module. Show locations on a map. Search by geoposition.
http://www.dynamicagency.com/labs/silverstripe-locator-module/
BSD 3-Clause "New" or "Revised" License
21 stars 7 forks source link

REFACTOR LocatorController index() - remove getTrigger() check for loading Locations on page load #219

Open jsirish opened 4 years ago

jsirish commented 4 years ago

Is your feature request related to a problem? Please describe. The getTrigger() was meant to prevent locations from loading on page load, by checking if the GET variable was set for the field marked as query_trigger. The ability to not load all location results prior to a search is to ensure performance with a larger set of Locations (100+).

The getTrigger() method is more complicated than it needs to be.

Describe the solution you'd like In index(), replace the getTrigger() check with a check against a $db boolean on Locator class that can be set via the CMS. Default is false. If marked true, all results would display on initial page load.

Describe alternatives you've considered Instead adding a config via yaml to set default behavior for the class. This offers less flexibility without subclassing Locator so the config can be different.