How can I search multiple value fields in a view? - drupal

I'm fairly new to Drupal, but not to CMSs or PHP, so if I need to do this in code I will. It just seems it should already be possible with Views.
So, I'm making a view, and I want a 'combine fields' search filter for all fields. I can add my normal fields, but I don't seem to be able to add any field with "Display all values in the same row" checked under 'MULTIPLE FIELD SETTINGS'. This column simply does not show up in the options for the combine fields filter.
Any ideas? Might this be a solved problem? I can't be the only one...
Cheers,
J.R.

Related

Drupal 7 - Term reference field: how to add new term?

I have some texonomies in my Drupal website. Some of them have additional fields. I have some fields of type Term reference in my content-types.
When I am creating a new node of a content-type, I would like to have the ability to add a new term to the taxonomy while I'm filling the form of the Content-Type (with an "add item" link/popup...).
I can do that if I use Entity Reference fields, but I cannot using Term reference field. Could you help me, please?
Thanks
UPDATE: I installed "Taxonomy access fix" module (https://www.drupal.org/project/taxonomy_access_fix) and it allows me to set capabilities per each taxonomy based on user role. Now I only need to add a new term to a Taxonomy on a form level using Term reference field (I canno use autocomplete because I need the user to see all possible values like with a dropdown).
Any help?
If you change your widget to the autocomplete widget, it will let you add new values.
I agree with #Dark FlameS, in fact we are using the autocomplete widget for some of our students to add types of trees in the biology lab and they tag each with the scientific name.
And since we dont know these scientific terms, we let them add taxonomy terms to the list.
Slight difference however, we use the module Autocomplete Deluxe. Works like magic for us.
You are able to see what taxonomy terms are already available by clicking into the text area.
And as you type a taxonomy term, you will see what other terms are similar. If a tag is new, it will be added. one thing, dont allow them to delete your tags. We learned this the hard way.
See the image below on what it looks like as you add a tag.
Above is what you will see when you are adding the taxonomy field in your content type, this is after you install the Autocomplete Deluxe module
Above is What the user sees when they add or select a taxonomy tag.

Hide row in view if any field is empty

I have a Drupal 7 view that uses fields as display type.
There are three fields, and I don't want to show the row if any one field is empty.
Currently, I am adding a filter for each of the three fields to achieve this. meaning if I have 20 fields, I would have to go for 20 filters.
Is there an easier way of doing this?
P.S. I can do this by overriding the row style output template file, and then add some custom php code. But I want to know is there an easier way using the views administration interface.
When you select 'Fields' under 'Show' in View, in 'settings' you can check "Hide empty fields" option.
Cheers!!!
You can put a condition on view filter. If image field is empty then row will not display.

CCK create custom non-standard field

I've created new content type. And I want add new custom non-standard field. The field should consist of two text fields. Let's say: double text field. Ex.: Product content type and I want to add features of product such as: weight, length etc(many features). First field is 'Feature' and the second one is 'Value of feature'. The question is: How I can realize such a field? Module, hooks?
You can create your own field pretty easily, you'll need a custom module and to implement a bunch of hooks like you suggest.
Rather than go through all of those here you'd be better off downloading the Examples module, and looking at field_example. I've based tons of custom fields off of that code and they've all worked perfectly. Plus the module is well commented and gives you good insight in to the way the field/widget systems work.
Hope that helps
One straightforward alternative is to use the Field Collection module

How to filer what is shown in my view according to the content of one of the content fields?

I would like to know how to filter view (block) according to content of one of my fields in that view.
E.g. I have added to my block view a field called Car description, which contains a text with something like "This car is convertible and the best on the market." etc.
Now, I want in filers section set up a condition to show just that content which contains in the field Car description a word convertible.
I was wondering that if this is not possible, I can maybe create a custom field which will contain a PHP code with condition if else, so the result of this custom field could be 0 or 1 and then the filter could check it better.
However, I think that filter is applied before any of the fields are populated, but maybe I am wrong.
How to solve this problem? Did anyone dealt with similar situation?
Thanks in advance for your advice.
You should use views filters.
In filter settings you can specify properties of that filter. For example you can check field for containing word 'convertible'.
However for your case I would use taxonomy. 'Convertible' word is a good candidate for taxonomy term.

Content Taxonomy along with Conditional Fields

I'm still young at Drupal.So please correct me wherever needed.
I have a requirement wherein I want my content type to have my own fields (achieved with CCK), then I want one of the fields to be a selectable drop down and each drop down value should actually categorize them so that each type can come on separate page. This I managed with taxonomy. And in addition to these,I wanted some other fields in the same content type to be dependent on a particular value in the drop down. So I used conditional fields. And in order to use taxonomy term as field,I used content taxonomy. But unfortunately, conditional fields doesn't see the content taxonomy drop down (it works perfectly well if its a normal non-taxonomy drop down).
So basically,
I want content to be separated (i.e.
on different pages) on the basis of
a value selected from drop down.
And if a particular value is
selected from drop down, few other
fields should become visible.
How am I to incorporate these things? Am I on the right track or completely off track?
I am using Drupal 6.14. :)
Thanks for all the help!
I think you are on the right track, but the Conditional Fields is still in beta, so bugs/missing features are to be expected. Also, Content Taxonomy is a bit special compared to other CCK modules, as it only provides a replacement of the taxonomy fields on node edit forms, but is not present/active during node rendering.
That said, your Problem is already filed as a feature request in the issue queue of the conditional fields module, and there are some patches available and discussed to solve it - so you might want to check out that thread.
I'm not completely sure how you require the 'different pages' part to work, but if everything else works with a non-taxonomy dropdown - and you don't have time for the issues with Conditional Fields to get shaken out - then you may be able to set up a View page that filters on the value of the CCK node.

Resources