silbinarywolf / silverstripe-mrfilter
A filtering form API that's fully configurable in the CMS and has live front-end Google Map filtering.
Installs: 4 801
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 6
Type:silverstripe-module
Requires
- silverstripe/framework: ~3.1
Suggests
- silverstripe-australia/addressable: Allows retrieval of an addresses latitude/longitude via Google geocoding API
- silverstripe/solr: Allows keyword searching in the filter and geospatial filtering based on users latitude and longitude.
This package is not auto-updated.
Last update: 2024-12-13 08:53:44 UTC
README
WARNING: This module is currently undergoing breaking API changes, use at your own risk.
Mr Filter is a filtering form that's configurable in the backend and able to be attached to a Page.
It offers a simple to use API for filtering DataLists in the backend as well as offering flexible front-end filtering logic that is done without using slow backend responses.
Toggling Map View
Occassionally in your front-end code, you'll want the map to start hidden and be toggled on with a button. The following code will ensure that if the map starts hidden, that it won't have an incorrect display once it becomes visible.
$('.js-view-map-button').click(function(e) {
$(this).addClass('is-active');
$('.js-view-map').removeClass('is-hidden');
$('.js-view-listing').addClass('is-hidden');
// Fix Google Map display:none; bug
$('.js-listfilter-widget_googlemap').trigger('GoogleMapRunDrawInit');
});
Requirements
- SilverStripe 3.1 or higher
Installation
composer require silbinarywolf/silverstripe-mrfilter:1.0.*