My apologies if this is the wrong area to ask this question but I am a loss on how to proceed.
I have created a profile for producers of livestock. I have included several checkboxes on the profile form where a user can specify the type of livestock they raise, such as:
-chicken
-duck
-pheasant ...
I cannot figure out how to print out the farmer's choices for these animals when anyone views an individual's profile. I've tried many different ways in profile2.tpl.php including conditionals, such as:
if (render ($content['field_chicken']) print ("Chicken");
or
if ($content['field_chicken']) print ("Chicken");
How do I target the true/false value in the boolean field (such as the field field_chicken in the example above) so that only the checked values are shown when the profile is viewed?
Comments
Comment #1
joachim commentedI don't understand the problem.
If each type of livestock is a separate boolean field, then don't they just output with a label and a 'yes/no'?
What would be better though would be a multi-valued checkbox field. Output will be much simpler then.
Comment #2
screeno commentedYes, the labels do output but there is nothing printed for the value of the field. There is no 'yes or no' outputted after the label.
However, your advice to use a multi-valued checkbox field simplified matters greatly. I now have the output I needed.
Thanks for taking the time to help me. Your module is a great solution for my project.
Comment #3
screeno commentedClosed