Hello -
I'm working on a custom content template using the contemplate module and have run into a problem I've never had to tackle before. If you wouldn't mind spending a couple minutes helping me, please read on.
I've got a CCK field that has five options. The CCK field allows the user to check one or more options. Let's call it: Selections
Selections
- Option A
- Option B
- Option C
- Option D
- Option E
What I'd like to do in my content template is display certain fields based on whether a certain option has been selected. I know how to show a field with contemplate based on whether the field has a value or not, but I don't know how to do it with various possible values.
So, let's say "Option A" has been selected, then I want to be able to determine that using PHP so I can output a certain field that should only be visible if Option A is selected. I have found the conditional template module and that seems to only control whether the fields are available in the node creation form, not in their actual display.
Thanks for your help. I'm really lost here!
Comments
If you want to conditionally
If you want to conditionally print a value if it's set you would use something like
To also limit passed on the value of another field you would change
to something like
'field_sections' needs to reflex the actual field name and 'Option A' the actual value you are checking for.
Nevets, thank you so much.
Nevets, thank you so much. This is exactly what I needed.