I used to do this in D5 with a node reference field, but am not quite sure how to do this with views 2 and the Province field from Location.
I have a bunch of school nodes with locations. I have 50 state nodes. I want to put a view in the state nodes that shows the school nodes in a given state on that state page.
I've tried using the arguments (node id from url). Any ideas?
I can paste the view if needed.
Running views 2.5, location 3.x.dev (from an hour ago), and Drupal 6.10.
Thanks.
Comments
Comment #1
yngvewb commentedI'm in the process of upgrading from D5 to D6 myself and I have also run into a similar problem.
In Drupal 5 I used a combination of GCG (I improved the GCG view to support province as an argument), location and gmap. Now when GCG not is going to be support anymore I need to find a solution with just location and gmap.
This is what I have now in Drupal 5
All schools in the whole country:
http://utdanning.no/utdanning/vilbli_no_adr_14298/idret1----
Schools in a province (fylke):
http://utdanning.no/utdanning/vilbli_no_adr_14298/idret1----?fylke=Akershus
Comment #2
rooby commentedThere is nothing in location to provide this out of the box.
You could use the Location: Province argument and then for "Action to take if argument is not present" select "Provide default argument", then for the "Default argument type" select "PHP Code" and in the "PHP argument code" text area add code something like the following (remember not to include the php tags):
This code will, only on node view pages, load the node being viewed and return the province for the first location of the node. This is a basic example, you can modify it to your requirements.
So this will provide your view argument the province of the first location of the currently viewed node.