0

I have a field that is a single on/off checkbox. Whenever it has been selected it outputs a key of 1 into the panel display, if it hasn't it outputs a 0. I want it to output custom html for a link to another page if it's a 1 and I want it to become disabled/hidden if it's 0. The resulting block/field/html needs to be inputted into a panels display, just like the key currently does.

As of right now, I'm using jquery to do this for me, but it seems like there HAS to be a way to do this with drupal. I've looked into conditional_fields and field_conditional_state but they seemed to be more focused on entering conditional information and not on only making conditional outputs. I'm currently looking into minipanels, panel pages, and context right now to figure this out, but haven't found an easy way of doing it and it feels like I'm overthinking it.

I know that there's a States API that handles this kind of thing, but there's surprisingly little information that I've been able to find on how to apply it to displays. Any help here would be greatly appreciated.

Thanks, Cole

0

If I understand your case you could : - have a Static field, containing your link - use Conditional Fields Module and set up a condition with :

"dependee" = your checkbox "dependent" = your static field (containing your link to another page) condition = dependent is visible if dependee has value 1

|improve this answer|||||

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.