Hello, I have two questions regarding the use of arguments and filters. Both are hopefully obvious to others, but my inexperience is letting me down.

First, I was wondering if it was possible to filter a term view based on the presence/absence of content nodes. I created taxonomy terms for all the countries in the world (by importing a csv file with location and bounding box info), but I only have content associated with a few of those countries.
When I display my openlayers map, I am hoping to only have markers appear for countries that have associated content. This way when new content is created (especially if it is done one at a time by other users), there is a list of all the countries from which to choose but the map isn't cluttered with hundreds of "empty" terms.
I'm assuming I would accomplish this with a filter of some sort, but I can't figure out how, and I can't find a module that might help me.
Suggestions?

Second, I went through the 25 minute tutorial on building a geo enabled blog with drupal. In the second half, it talks about how to create a block that will use a taxonomy term's bounding box information, using the geo taxonomy module, to create a map showing only the area defined by that term. I can't find any good resources to help construct the Taxonomy: Term ID argument (mentioned about 3/4 of the way down the tutorial) that will match my new map with the taxonomy term that is chosen. I'm pretty clueless when it comes to php code etc, so I don't understand how to construct this argument.
Any suggestions? Any great argument tutorials I should go read/watch?

Thank you very much!

CommentFileSizeAuthor
#2 boundingbox.png234.41 KBYanni

Comments

Will White’s picture

Status: Active » Postponed (maintainer needs more info)

Hi Yanni,
To your first question, you can limit your view query to only return tags that have nodes by adding the "Taxonomy: Node" relationship to your view and checking the box next to "Require this relationship" in the relationship settings.

For your second question, you might want to start by looking at some documentation on arguments. Have you seen this page? http://drupal.org/node/54455

For example, a path like `/map/575` only shows the taxonomy term with the ID of 575. In the context of the tutorial, limiting the result to single term is only going to load the bounding box for that term. The bounding box, of course, is hidden, but the map uses it to know where to zoom. You'll want to configure the "Taxonomy: Term ID" argument.

Try experimenting with a basic table view of taxonomy terms, before adding the complexity of the map.

Here's a quick example showing how you can use the arguments text field to test your view.

https://skitch.com/diggersf/r4nan/edit-view-test-localhost

Will

Yanni’s picture

StatusFileSize
new234.41 KB

Many thanks Will for your help. That solved both of my problems. I really appreciate it.

As a follow up question, I can't figure out how to filter the bounding box view to only show nodes tagged with that term. Basically when someone clicks on a country, I want the bounding box to show the locations of only the nodes tagged with that country. At the moment my map shows a marker for every node (including nodes located in neighboring countries visible around the country of interest.

Thank you again,
Yanni

mailking’s picture

+1

tmcw’s picture

mailking: this is a support request. What is the +1 for?

mailking’s picture

Hello Tom,

I am recently re-discovered Drupal, and I am working on and off on my new website. I played around with "your" ManagingNews project and will implement MapBox. I am without internet a lot, and I wanted to subscribe to this thread to read up on things later. I mistakenly put a +1 mark there. It should have read: subscribe.

Sorry for the misunderstanding.

Adventurous greetings,
Coen

p.s. did I mention that I love the stuff you guys are doing. I especially like the http://preparedness.interaction.org/map and want to implement that somehow in our ongoing roadtrip - eight years on the road now!-

mgifford’s picture

Component: OpenLayers Views » OL API

I've been looking at how http://managingnews.com does this as they seem to have a great example for the use of OpenLayers. Unfortunately it's with Drupal 6.

They have created a map layer with all of the countries specified in it. It's specified in a CSV file that's included as part of the distribution.

ken-g’s picture

Status: Postponed (maintainer needs more info) » Closed (outdated)