0

I am creating and classifying nodes by:

  1. A main taxonomy
  2. A secondary geographic location taxonomy

I created a View for the display of these nodes. It accepts a term ID from the main taxonomy via URL, and provides a Hierarchical Select "exposed filter" for further filtering by geography within the displayed nodes.

I notice that if a user does not select any location from the exposed filter, all nodes from across the world are displayed. But when I select USA, only USA nodes are displayed.

That is the desired behavior, however, I need to create some nodes that have "Worldwide" scope, and appear in the view even when the geographical filter is activated. It would be a great hassle to create nodes for each and every location.

I could hardcode this in some way: I even considered a separate taxonomy of worldwide nodes, and creating a block which is always displayed on top of the filtered results. But the problem with this is that the order of node-creation is also important, and my solution would appear disjointed.

Any ideas to nudge me in the right direction would be greatly appreciated.

2 Answers 2

2

Assuming I understand you correctly... why don't you create a custom checkbox field "Worldwide?" for the node type? Then in any views you could insert an OR checking if the node has it set. Still, you would be able to group the results by another field, such as geographical region name.

This is where you get the dialog in Views3 widget dialog

8
  • Thanks! I will check this, it would be really cool if it was that simple!
    – Aditya M P
    Commented Jan 30, 2012 at 16:08
  • 1
    Next to the Filter Criteria header (where it says "add") click to reveal Rearrange option. I'm sure this will get you started :) Commented Jan 30, 2012 at 17:42
  • 1
    Shame on me, aditya menon, I noticed only now that you are on D6. I'm not sure ORs are available in the past version, as I stepped on Drupal's bandwagon at D7 and Views 3. Sorry if I gave you a false hope. Commented Feb 1, 2012 at 16:59
  • 1
    Oh well, I hope someone with Views2 helps you out. If there is no OR available, then Views3 is a real improvement! Will try to attach some screenshots to give you an idea how it looks. Commented Feb 1, 2012 at 18:58
  • 1
    You could also try making "Worldwide" additional branch in your taxonomy and allow for multiple terms in a node. Then in any View that is supposed to list geo regions, you could provide additional "AND" condition saying "is not Worldwide" so that the branch is not listed as a region. I think you have now a couple of solutions to pick from. Commented Feb 2, 2012 at 11:54
1

We had a similar problem, we had to distribute nodes by brand > department and country. Sometimes we would need to broadcast to all...

The solution for us was changing the taxonomy to a cck "Content Taxonomy Fields" and using the tree widget, that way we could apply a node to all (or worldwide). Then we added some custom js which allowed check all. (after all world wide rather than being a single selection is actually all of the countries in the taxonomy).

2
  • Thank you for the answer, I especially did not consider the JS part. I think I can just create a 'check all' JS (assuming I'm allowed to modify the HS Dropbox widget's value, it's quite arcane to me) that will add a node to all countries :)
    – Aditya M P
    Commented Jan 30, 2012 at 11:57
  • Kindly check my related question: drupal.stackexchange.com/q/21061/2384 I think you might have run into that, would you please share how you solved it, if you did?
    – Aditya M P
    Commented Jan 30, 2012 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.