Closed (fixed)
Project:
Views (for Drupal 7)
Version:
6.x-2.11
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Mar 2009 at 14:24 UTC
Updated:
9 Dec 2011 at 16:42 UTC
Jump to comment: Most recent file
Comments
Comment #1
merlinofchaos commentedSince Views doesn't really handle an 'OR' that's not very straightforward in Views at all.
Can you be more specific with what you mean, though?
Comment #2
stephthegeek commentedClosing for lack of follow-up
Comment #3
Sc0tt commentedI think I am looking for the same functionality. I’ll explain my situation.
I have two vocabularies associated with my story node. One vocabulary is called “Page” and the other is called “Section(s)”. Each vocabulary has exactly the same terms.
I want to use the first (required) vocabulary called “Page” to construct a nice seo-friendly url using pathauto’s termpath and at the same time give the node a permanent location on the website. For example “high-school-sports-baseball-(node-title)”.
I want to use the second vocabulary called “Section(s)” to provide functionality similar to “promote to front page”. I want to be able to display the same node not only the front page; but in multiple locations (or sections) of the website.
Example #1:
A daily team update by the high school baseball coach isn’t newsworthy enough to place anywhere else on the website. In this case, only the “Page” vocabulary would be used and the node would only appear in the High School - Sports - Baseball section of the website by the node author selecting the term “high-school-sports-baseball”.
Example #2:
The baseball team winning one of their home games is newsworthy enough to be promoted to the High School - Sports section. In this case, the node author would select the required term “high-school-sports-baseball” from the “Page” vocabulary as he did in the first example above. However, since he wants to promote the story to the High School - Sports section, he would also select the term “highschool-sports” from the “Section(s)” vocabulary. Or lets say they won state champions. The node author would select two terms from the “Section(s)” vocabulary: “highschool-sports” and “Front-Page”.
To accomplish this, I was hoping to add both the “Page” and “Section(s)” vocabularies to the views filters and somehow tell views to display all nodes with terms matching either vocabulary. Is there a way to do this?
Thanks for reading my long post and thanks for your help. Views 2 is awesome!
Scott
Comment #4
siva_epari commentedHi all
I think this is a very old thread but my requirement is specifically this. I am working on creating a views exposed filter which filters based on multiple vocabularies. I got the UI from the multiselect module (as the same UI & functionality was the requirement) but was unable to combine the vocabularies into one filter.
As you can see in the attached image, the first row is the first taxonomy filter which has some appended HTML & JS to achieve the multiselect functionality (Did this by hook_form_alter and added the html & js to
$form['#prefix']) and in the second row the second taxonomy filter is placed which has a different vocabulary. The requirement is now that both vocabularies(First & second) be combined into one as<optgroup>'s.So the final requirement is to put each vocabulary filter selected as a
<optgroup>in one single taxonomy filter and remove display for all other visible filters, enabling sending any term of selected vocabularies through the filter system and fetch content related to any of the selected terms.I used views_or in between each of the selected taxonomy filter, and manipulated the views-exposed-filter form using hook_form_alter and adding all tags from
$formtaxonomy filters to the first filter. When i select tags and press filter, it gave me "Invalid option selected: contact Administrator". Also i tried to export the view as file and manually change all taxonomy filter "identifier" as the same one. By that i get the first selected vocabulary terms in the first filter and others are not visible.Please help me to achieve this functionality in views or suggest me any other alternative or contrib module which has the multiselect functionality to filter content depending on previously selected multiple vocabularies.
Regards
Siva
Comment #5
merlinofchaos commentedUse hook_form_alter to combine the vocabulary terms you want onto the filter?
Comment #6
siva_epari commentedI tried to do that but i when we select the options and click "refine results" i am getting a error "Invalid option selected. Contact your Administrator"
Is there any other change required (In the filters) if we hook_form_alter the views-exposed-form filters and manually add extra options?
Comment #7
arski commentedhey guys. I'd love to have this too. Just as a note - the advanced search page provided by the Search module does just that, it offers a field where all vocabularies are listed as optgroup's and the terms are then listed as select items.. this should be possible inside views too surely?
Thanks in advance!
Comment #8
arski commentedhttp://treehouseagency.com/blog/neil-hastings/2010/01/19/views-handler-e...
This tutorial shows exactly how to do just that! Works like a charm - would be a brilliant inclusion to the Views module imo.
Comment #9
iamjon commentedI think the "views or" module may be appropriate in this case http://drupal.org/project/views_or
I'm marking this as closed. Please feel free to reopen and add more information per the submission guidelines http://drupal.org/node/571990.
Comment #10
technikh commented+1 to make this a feature in the core views module