Render checkboxes into columns

rburgundy - October 26, 2009 - 04:02
Project:Content Construction Kit (CCK)
Version:6.x-2.x-dev
Component:General
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi Drupal Community-

Is it possible to drupal render the checkboxes into columns? Or have control over each checkbox?

I have

<?php
print drupal_render($form['field_hobbies']);
?>
with about 50 checkboxes for user to select from, but all is showing in one long column. I want to render them on node-profile-edit.tpl.php into 5 columns with 10 rows each. I've looked at the css on the page and didn't seem to solve my issue.

Also, on the node-profile.tpl.php I would like an image to show for every checkbox selected ie soccer = soccer ball image

Understanding this will really help me accelerate in changing my current website to drupal =)

Thanks!

#1

markus_petrux - October 26, 2009 - 15:11
Version:6.x-3.x-dev» 6.x-2.x-dev
Status:active» fixed

You can drupal_render() individual elements in checkboxes. Note that the checkboxes element expands to a number of checkbox elements.

For an example, see how Drupal does this in tables where checkboxes are spread along a table column. Permissions table, module admin, users admin, etc.

#2

System Message - November 9, 2009 - 15:20
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.