Issues with using hook_theme & #theme for the form element level

1 +
SAVEL's picture

kind of solution for your problem

I would like to thank you for this post. I had the same quesion of theming drupal form elements and your article had helped me to understand basic principles for that.

Trying to repeat your example I've encountered the same problem as you. Even more: I couldn't manage to use your workaround. The possible reason is that I'm doing my first project with Drupal (and third project in web-developing).

So it took a whole night to make it work the way i need. Here is my theme_uc_bmcustoms_theme_checkbox:

function theme_uc_bmcustoms_theme_checkbox($checkbox){
  $output = '';
  foreach (element_children($checkboxes) as $option){
    $output .= '';
    $output .= drupal_render($checkboxes[$option]);
    $output .= '';
  }
  return $output;
}

Hope it helps,

SAVEL

Post new comment

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <p> <h2> <h3> <h4> <h5> <h6> <img> <p>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <php>, <python>, <ruby>. Beside the tag style "<foo>" it is also possible to use "[foo]". PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Image links with 'rel="lightbox"' in the <a> tag will appear in a Lightbox when clicked on.
  • Twitter-style @usersnames are linked to their Twitter account pages.

More information about formatting options