Skip to main content
1 of 3

Filter GeoJSON feed on a value in the path

I have GeoJSON feed, created with a view in Drupal 7, that I want to filter on a path value in the url of the loaded page (/path/%). The feed is loaded as an Openlayers map on a page. The feed seem to work with its own feed-url and is not aware of the site url. Contextual filters in the view don't work either. I can use hook_views_query_alter or hook_views_pre_view. But I don't know how to bring the value from my path into the hook function. Any suggestions or example code snippets?