Hi guys, love this project.
I wanted to know if using contextual filters as a location differentiator has ever come up? I've been trying to found an older issue but couldn't find it.
What I want to accomplish is to make a block views with a maps that shows all the points of a certain content type and when you are viewing a node page from one of the markers in the map to use a different marker.
I think this is possible to do with OpenLayers. It would be amazing to do with this module. What I was thinking of maybe allowing contextual filters to be used as a location differentiator so its useful for more user cases. I'd like to know if there is any current workaround or if there is interest in this feature I'd be willing to sponsor some of the development.
Comments
Comment #1
rdeboerHi Nicolas,
Glad you like the project!
You're the first to ask about contextual filters being used as marker color differentiators.
If you add the contextual filter also as a field to the View that is formatted as a map, then that field should come up in the differentiator drop-down.
Would that get close to what you're after?
Rik
PS: there's no guys (plural) -- just me ;-)
Comment #2
rdeboerWrong version...
Comment #3
ipwa commentedI can add the field in my case it would 'Node ID'.
When I add the node id field I can use ti as a differentiator, but when I tried it out and set the nid value in the differentiator to one of the values of the markers like 89 for example, I would get the following message when viewing the map: "IPGV&M: no differentiator values found for node_nid. Cannot set marker images."
Even if that worked, that wouldn't exactly work for me because I would need to do a map display for each of the nodes and assign the static nid differentiator to each view display. One idea I had was that it would be amazing if the differentiator value could be set with a token from the view (replacement patterns). That would be awesome because I could add the nid field, set it to not be displayed and use that as my differentiator by setting it to [nid].
Comment #4
ipwa commentedThanks for all your hard work btw, really appreciated :)
Comment #5
rdeboerRe #4: Thanks!
Re #3:
I'm not happy that you're getting this error: "IPGV&M: no differentiator values found for node_nid. Cannot set marker images." I'll look into it. You're not using Search API are you?
So **if** the node_nid worked, then the only thing that would worry you is the fact that it is displayed in the marker balloon?
Rik
Comment #6
ipwa commentedNot using the Search API.
If the node_nid worked that would be great, it is easy to hide the nid in the field configuration and not have it displayed on the marker ballon.
The problem would be how to make the node_nid dynamic. So I wouldn't have to make a view display for each node. A way this could be solved is by allowing us to use replacement patterns as differentiator values.
Comment #7
rdeboerRe: node_nid: that's what I thought also. It is meant to work, I don't understand why it doesn't. Do you use Geofield? If so, what version? 7.x-1.x or 7.x-2.x ?
But apart from that bug, I still don't see how the [nid] replacement pattern is going to help you.
Just as with node_nid you'll have to specify for which value (or value range) of node_nid/[nid] you want to use which marker color....
What am I missing?
Comment #8
ipwa commented7.x-1.x, should I update to 7.x-2.x?
Yes you're correct I was getting confused about using the replacement pattern, I see now it wouldn't work.
The value I need comes from the contextual filter nid. The thing is how to get the current nid into the value of the nid field. Any ideas of how this could be accomplished?
Comment #9
rdeboerActually just remembered in Views there is a special replacement pattern for contextual filters: %1, %2 etc.
But that's currently not implemented in IPGV&M either....
Comment #10
rdeboerContextual arguments (as appended to the the URL) can be used as location differentiators as of version 7.x-1.24.