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

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

Related

Use of dynamic MDX Categories in Global Filters in the icCube application (dashboard)

Situation
I've defined a couple of MDX++ Categories in icCube and I want to use these as Global Filters in the application. An example of a MDX++ Categorie is
create category member [Stats].[Top 100 Leveranciers].[Totaal].[top 100] as
order(TopCount([leverancier].[leverancier].[leverancier],100, [measures].[bedrag]),[measures].[bedrag], bdesc),
add_children=true
If I use this as a Global Filter in the application, all my dashboards are filtered, showing the data for the "Top 100 Leveranciers". Perfect, so far.
Now comes the problem/ question
Some users have a security setting that allows them to see only a subset of the data. The "Top 100 Leveranciers" should therefore be different to them, then to users that can view all the data. But, it is not. The "Top 100 Leveranciers" give exactly the same members for the persons with access to sub-set as to users that can access all.
--> How can I achieve the desired functionality in icCube?
My analysis
This is what I believe is happening 'under-the-hood':
To include a CATEGORY as a global filter option, it has to be defined in the SCHEMA DEFINITION as a SCRIPT. It is only allowed (so far) to have STATIC categories in the script. So I guess I am looking on ways to create CATEGORIES that can be used as global filters, but are DYNAMIC for dashboard users.
Not sure to understand why the Top members are not filtered by the actual user access rights: should be the case. Better to contact icCube support directly.
Here is a quick details about STATIC vs DYNAMIC evaluation of the categories from the online documentation:
STATIC | DYNAMIC : an optional modifier to specify the evaluation context. The default value is DYNAMIC:
in that case, when evaluating the formula the list of members is filtered by the slicer
and/or sub-select content. In STATIC mode, slicer and sub-select are ignored.

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/

Expose filter multiple search in drupal

I have one Drupal website where there is a list of all temples, mosques, church etc available. Now i want a search form in my front page where user can search temples, mosques, church etc. I am using View exposed filter for searching results. But problem is when i go to add filter criteria then It ask for specific CCK field to exposed.
In Drupal machine name is always unique. So for temples it takes different machine name and for mosques it takes different.
I want only one search form where user can search all temples, mosques etc. Right now i am using different search form for different one. How can i do this with only one search form???
One more thing I am using these modules for handling addresses and locations
Address Field - 7.x-1.0-beta3
Geofield - 7.x-1.1
GeoPHP - 7.x-1.6
Geocoder - 7.x-1.2
How can i search results based on city and locations?
Assuming that you want to make the searches by name, then you should use the same field for all the temples' names, regardless of their type. By doing that exposing that field will do what you want.

A way to limit taxonomy exposed filter options in view with arguments in 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.

Resources