I am using Gmap 7.x-2.9 and Location 7.x-3.6 on my Drupal 7.34 site. I have setup a custom content type for "Locations". So if I, for example, added a new Location called "California" I could add in all of our California locations so when I go to the California page, I will get a Gmap displaying all of our CA locations. I am currently using the default block that comes with the Location module and set it up to display in the content area for my "Locations" custom content type nodes. This works and it indeed displays markers for all of the CA locations. The problem is nothing happens when I click a marker. I would expect to get a popup bubble with the address information for the clicked location. I see nowhere in any of the configuration for that block to change this behavior. You just don't get a popup. SO I figured what I could do is make my OWN view block and set it up where the content type is Location and only display it on the Location content type nodes. This also works, but when I go to any Location node, like California for example, it displays ALL of my locations in the entire system (other states). I want it to only display the locations for the location node I am currently viewing. I am thinking contextual filters? I just can't seem to figure out the right combination of settings in the view to display locations for the location node I am currently viewing. If I could figure this out, I can use the settings in the view to add the popup and decide what goes in the popup when you click a marker.

Thanks in advance for any help on this one.

1 Answer 1

  • Filter on 'Content: Nid' in contextual filters.
  • Under 'WHEN THE FILTER VALUE IS NOT AVAILABLE', choose 'Provide default value' and 'Content ID from URL'

This will look for a node id in the url and filter your view on that id.

  • THANK YOU!!!!!!!!! That was it. I had the contextual filter for nid, but nothing set for 'WHEN THE FILTER VALUE IS NOT AVAILABLE'. That was the ticket. THANK YOU SO MUCH.
    – Erich H.
    Jan 14, 2015 at 18:58
  • Happy to help. :-) Jan 14, 2015 at 19:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.