Hello.
In my content type (article), I have 2 geofields. One can get lat/lon from a "find current location" widget, the other can directly get an address which is later geocoded.

The used modules are geofield, geoPHP, Address Field, leaflet, among the others

What I would like to achive, is that the get directions module looks in one of the 2 geofileds (which at the end store lat/lon data), and if empty, looks in the other to get the data to show in the module's map.

By the way, it would be nice if it could automatically display the current position too, so to quickly get the track, but this is another issue.

Regarding the main issue, is it possible to achive that? How?
Thanks and kudos for the great module
Kinmen

Comments

hutch’s picture

The best approach would probably be to use the Views module with views_php module installed, write a view that has the contextual filter set to "nid" so that the view only appears on your content type instance. Put the lat/lon and a description in the Field list and see if you can build a filter in php to select what you want. Leave the display format to unformatted until you have got that working, then set up the map. Set up Views so you can see the Master, SQL and advanced settings so that you aren't working half blinded.

kinmen’s picture

Ok, I've followed your advices and finally got the results I was looking for. I've set the php code in the view's output and got the data from the variable provided by the view. Thanks!
K.

Issue can be closed

hutch’s picture

Status: Active » Closed (works as designed)