0

I would like to display only certain values of CCK value in a views field. In another words, I don't want to display certain values of CCK in the views field. Is this possible?

For example I have a CCK field called "fruits" with multi selections of "orange", "apple", "banana". I have also a table view with a "fruits" field and then I would like to display only "orange" value but keep this field empty when the field have the value other than "orange"(when the value is "apple" or "banana" ).

0

You can make use of a computed field (fruits_computed) which takes the input value of the fruit field (fruits) and filters values via php, sth. like this:

$allowed_values = array('orange');
if ( array_in($fruits_value, $allowed_value) ) {
$output = $fruits_value;
} else { 
$output = '';
}

Then in views, you do not use the fruits field, but fruits_computed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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