I have a proximity search view using latitude and longitude. How can I embed the view and pass the cck location coordinates to the view as arguments. In firefox using firebug I can see that the lat and long are being passed as distance[latitude]=46&distance[longitude]=-122 but don't know how to pass it as an embedded argument or even make it work using the argument test area in the view edit page. The search is setup right, I can expose a filter and all is well. I just can't get the embeded part.
This is the embed snippet I use for another embed view but don't know how to insert to lat long stuff.
global $current_view;
// * define the context-node's NID as the argument
$current_view->args[0]=$node->nid;
$myview = views_embed_view("local_stores", "default", $current_view->args );
The missing parts :(
$node->locations[0]['latitude'] ?> goes somewhere?
$node->locations[0]['longitude'] ?> goes somewhere?
$distance= 10 (I guess this might be a default setting doesn't need to change?)
$measurement = miles (I guess this might be a default setting doesn't need to change?)
Thank you
Comments
Comment #1
pwieck commentedStill looking for help on this
Comment #2
merlinofchaos commentedMaybe you should ask in the location module queue.
Comment #3
pwieck commentedDon't see how this is a location module question since it is veiws embedded related, but okay
Comment #4
merlinofchaos commentedBecause the submission guidelines clearly state that if a field/filter/etc is from a module, ask in that module's queue. I'm not sure how you expect the Views authors to know anything about location module's data.
Comment #5
paulbhartzog commentedwe had to do pass $current_view->args[0] for a view with only one argument, like this:
$myview = views_embed_view($view_name, "default", $current_view->args[0] );