Developer forum

Forum » Templates » Maps filter button dont work

Maps filter button dont work

Mikkel Toustrup Olsen
Reply

Hi,

I am trying to setup a map filter and I am using the default maps templates for the maps module. I have 2 groups attached (afdelinger, steder - both of these have subgroups with geolocations applied.) and they are being shown perfectly as buttons on the template. When I click the "Show All locations" button it renders all the locations which is to be expected. However, when I click the "Afdelinger" and "Steder" button, it does not render anything. On the module setup I have tried to apply "use only subgroups" - though this has no effect either.

My goal is to archieve somewhat the same functionality (left navigation) as http://danishagro.dk/index.dsp?area=7.

 

 


Replies

 
Nicolai Høeg Pedersen
Reply

Does your javascript console report anything?

 
Mikkel Toustrup Olsen
Reply

Hi Nicolai,

No, it does not report any errors whatsoever. Its odd, because I render "Show all locations" just fine - but when I hit the two other buttons all the markers disappear.

 

 
Mikkel Ricky
Reply

The filter buttons use the data-filter-values attribute from the locations to filter the list. Therefore, when using the default Maps template, the buttons filter on the parent group ids, but your locations only have the child group id in the data-filter-values attribute.

Try using

data-filter-values="<!--@ParentGroupID-->"

rather than

data-filter-values="<!--@GroupIDList-->"

in your Maps template.

Best regards,
Mikkel

 
Mikkel Toustrup Olsen
Reply

Hi Mikkel,

That does not seem to do the trick either. However I can see you have reported my support case as a bug - bug number: 15573 for reference. I will wait until further information :)

 
Mikkel Ricky
Reply

Have you tried using @ParentGroupID in your template?

<li data-lat="<!--@Lat-->" data-lng="<!--@Lng-->" data-title="<!--@Name-->"
   data-filter-values="<!--@ParentGroupID-->" …

It works like a charm (cf. the paragraph with id 270 on the solution you mention in your support case).

I've just updated the default Maps template and you can get a copy here: https://dl.dropboxusercontent.com/u/77245248/dynamicweb/maps/Maps.html

Best regards,
Mikkel

 

You must be logged in to post in the forum