A way to limit taxonomy exposed filter options in view with arguments in drupal - drupal

I'm building a product catalog where a particular section is displayed by views with an argument, a taxonomy id of a section.
But I also need to give user the ability to further narrow down the search by specifying the producer by choosing term in another vocabulary in the exposed filter.
I'm trying to limit the selection to terms for which nodes in a chosen section exist. Looks like the views_selective_filter and view_hacks are especially for that, but looks like out of the box neither of them takes into account the view argument. Is there a remedy or workaround?

Use Firebug or the devel_themer module to find the form ID of the form displaying those terms, then use a hook_form_alter in a custom module to intercept, and modify that form.

In the end I used views_taxonomy_selective_filter. I had to patch views module as I described in the comment in order to make it generate select options after processing arguments.

Related

What is the syntax to add a column to the Custom Form list that shows where in WF it is used?

Super simple.
When viewing the list of Custom Forms in Setup, I want to add a column that shows where those Custom Forms are in use (or null if used nowhere).
This is similar in principle to viewing the list of fields, which has a list of forms on which those fields are used.
What is the syntax I can use to add the appropriate column(s) to the view?
As far as I know, there is no linkage in the backend that connects categories (custom forms) to their host objects. This is probably because the list could be massive and the query would take quite a while to execute as it would have to traverse every object in Workfront or each form would store every parent object ID.
Unfortunately, you can't even search for objects by associated category IDs, so if you wanted to build this yourself you would need to query each object and search its categories to see if your custom form appeared.

Drupal views: list referenced nodes except the one used as contextual filter

i have the following case: I am building a website that has information on filmmakers and their films. I have a node type for the filmmaker, with biographical content, etc and another one for the films, with a field 'author' that references one or more of the filmmakers (since one film may have been made by several of them).
I also have a views block called 'filmography' that lists all the films whose author is the filmmaker (node) the user is seeing. Setting this up with a contextual filter was quite easy.
But now I want to present in this block along with the film name, all the filmmakers that may have made the film ('author' field in the film node) and that are different from the filmmaker being viewed. Displaying all the filmmaker nodes referenced by the author field is immediate, but I want to remove the filmmaker that I am using in the contextual filter. The goal is to get something like this:
Filmmaker 1
Movie 1
Movie 2 (with Filmmaker 2)
Movie 3
I have the notion that this might be done using views php and filtering the node references returned, but I wonder if there is an easier solution for that...
Thanks
Update: I have managed to get a result using the Views Field View module, passing the list of referenced nodes (filmmakers) as a contextual filter (node ID) and then adding another contextual filter (node ID as well) as an exclusion, and getting the default value of the letter from 'node id from URL option' (that is, from filmmaker's page the filmography view is embedded in). Keeping the question open for a while to get other, possibly more efficient, alternatives.
As I read your question, the Views Field View module popped into my mind as the obvious solution (then I saw your edit). I think this will still be your best bet. Definitely avoid using php fields as that is not a good practice in general from a security standpoint. If you are concerned about efficiency/performance, then you should just use views caching setting under the advanced options. Seems like this option is always looked over.
If you are looking for alternative options, one might be to use rendered nodes as your View style instead of fields, then use Display Suite to generate additional display modes beyond "Default" and "Teaser," create a view with the filters, then use the Entity Views Attachment (EVA) module to insert a view as a display mode field. While this is certainly a robust approach, it adds a lot of processing overhead with the rendered entities, so you definitely want to cache the results of that as well.
p.s. You might get faster/more responses over at https://drupal.stackexchange.com/

Drupal 7 and Views, contextual filters searching through multiple/combined fields. Is it possible?

I've worked with Drupal 7 and Views for a while now and I'm familiar with what Views allow by default and what is available as modular add-ons. Today I've come across an issue with Contextual filters, which allow you to pass in an argument via the URL and use this to filter the returned data.
Normal filters on the other hand can be exposed as a form and also allow for a field combination module which means we can search field{1,2,3} all at once and display the data depending on this input. (views_combined_fields)
Is it possible to tell Views to show me all rows (WHERE field1="test" OR WHERE field2="test" OR WHERE field3="test") but by default, if I add in multiple contextual filters only one of them is being triggered. In this example the "test" value is obtained from the url /data/test.
My problem is that users have a default group, but they also have the option to be added into other groups which are set in the field{1,2,3} fields. My current view shows all users WHERE group = "test" but I want users who have a secondary or tertiary group of "test" to also be displayed in this list.
As i understood, you are talking about Views Arguments, watch the tutorial video from
MustardSeedMedia.com. And useful video about Views 3 User Interface

Bulk update of Drupal 7 taxonomy terms

My Drupal 7 site has a bit redundant taxonomy structure with taxonomy terms "Article" and "Document" being used synonymously. Hence a large number (several hundreds) of nodes has both "Article" and "Document" terms applied to them. What I want to do is to "separate" these terms shuffling nodes randomly between them so about half of the nodes currently marked "Article" and "Document" will only have "Article" term and the other half will only be marked "Document".
What's the best way to go about this? Is there a module for bulk updating nodes adding/removing taxonomy terms? Am I better off with updating the database directly?
Thank you.
I found a solution for this:
I have "Administrative Views" module installed (Requires: Views, Chaos tools, Views Bulk Operations, Entity API - links are on the module page under dependencies).
From there you select the nodes you want to change and select "change value" in the "operations" dropdown and hit execute. Under "Fields for type {your nodetype}" you can click "tags" for example and enter the new value to overwrite all - or you click "Add new value(s) to Tags, instead of overwriting the existing values." and the value will be added.
It turns out adding a tag this way, there are new tags added for every updated node - so if you edit 20 nodes and add the tag "stackoverflow" there will be 20 tags called "stackoverflow" in the terms list. You may then merge the duplicates with "Term Merge" into one final term.
Since you need to update the taxonomy structure in bulk you can use - Taxonomy Manager
http://drupal.org/project/taxonomy_manager/
Which apart from other features has -
dynamic treeview
mass deleting
mass adding of new terms
moving of terms in hierarchies
You can also take a look at a similar question -
https://drupal.stackexchange.com/questions/11494/adding-taxonomy-terms-to-multiple-nodes-at-once
If nothing helps updating the database sure seems a simpler option, but use it only if you are very sure of your query, and don't forget to take a backup before.. :)
Taxonomy Manager is the a very good module for these purposes I used it myself to tag and add vocabularies to my website that has more than 100 posts. Its interface is also very intuitive and user-friendly.

Weird hierarchical select requirement for Drupal

Anybody know of a module or other way to do a hierarchical select in Drupal that first pulls in a taxonomy vocabulary from which you select and then based on your taxonomy selection limits a CCK related node field to a specific content type.
AFAIK, there is no module that does that. A node reference field does allow you to specify a view as its source, but unfortunately, you cannot pass a dynamic argument to that view.
If you can figure out a way to take the selected taxonomy term and pass it to the view as an argument to filter the results by, you're done...
There is a start for something similar on http://drupal.org/node/473670, but that code fetches the dynamic argument on the PHP level from a GET variable. The behavior you describe should work on the Javascript level, because your argument is a variable selected on the form by the user.

Resources