How to render taxonomy checkboxes in CCK form as columns?

Events happening in the community are now at Drupal community events on www.drupal.org.
bwright's picture

Hello. I have a CCK content type with several fields that are long checkbox lists of taxonomy terms. I would like to be able to render the checkboxes in columns so that filling out the node form will not require so much scrolling (and to just make it look a little nicer). I'll attach a screengrab of what I'm after. I've been searching around for a couple of days but haven't found a good way of doing this. Any ideas on how to accomplish this much appreciated.

AttachmentSize
columns.jpg16.29 KB

Comments

http://drupal.org/node/41936

BrandTim's picture

http://drupal.org/node/41936

Skip the post and go straight to the fist comment.

BrandTim

thanks for the link. This

bwright's picture

thanks for the link. This looks promising but I'm a little confused--Nancy says she 'adds a div (using #prefix and #suffix)' to the form output so that she can style it using css. I'm not sure how to add this markup to the rendered form. Do I use a preprocess function in my theme's template.php? Or is there some other method?

bwright's picture

...and without adding any divs or other markup:

.form-checkboxes .form-item {
float:left;
width:50%;
}

Use css as bwright suggested

wilmar81's picture

I would suggest to use a fieldgroup and add a css later. But the solution bwright provided is easier, lighter and better. you can customize your checkboxes better if you look in the html code. Each checkbox has an id, which allows you to add deeper customization.

--Willy

Life worth it to live. No matter what you're going through. Only your weakness can overcome your strenght.

--Sites
http://www.telecomaroc.com/
http://www.squaresystems.co.ma/

There is a module for that :)

mattyoung's picture

I created a module that does multi-column checkboxes/radios: http://drupal.org/project/multicolumncheckboxesradios

I am lookng for ways make CCK checkboxes/radios widgets able to incorporate this. If anyone knows how to do this, please let me know.

Love it!

kbk's picture

Thanks much mattyoung!

Thanks!

supercontra's picture

Thanks mattyoung

Content Construction Kit (CCK)

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week