[themes] how to theme [class/id] a nord_form?

Christopher M. Jones cjones at partialflow.com
Wed Nov 11 03:09:57 UTC 2009


Those ids are inserted by the devel themer module. Disable the module 
and they go away.

sebastian wrote:
> Hello Drupalites,
> 
> I am tryign to figure this out.
> 
> When I have a nord_form, either for creation or editing, I get a lot of 
> id's like: #thmr_81, thmr_86, #thmr_91, #thmr_98
> 
> If I try and use CSS to access them [perhaps setting display:non for 
> non-tech savy web admins]
> 
> Then this works, UNTIL something else changes on the page, and then the 
> numbers all change... SO, I need to find a way to give these random 
> place holding id's actual ID's that relate to the content inside of them 
> [authored by, published, file upload etc.]
> 
> I found the hook:
> 
> <?php
> /*
> * Theming the node form
> */
> function phptemplate_node_form($form) {
>    $output = "\n<div class=\"node-form\">\n";
> 
>    // Admin form fields and submit buttons must be rendered first, because
>    // they need to go to the bottom of the form, and so should not be 
> part of
>    // the catch-all call to drupal_render().
>    $admin = '';
> 
>    $buttons = drupal_render($form['buttons']);
> 
>    // Everything else gets rendered here, and is displayed before the 
> admin form
>    // field and the submit buttons.
>    $output .= "  <div class=\"standard\">\n";
>    	$output .= drupal_render($form);
> 	
> 	
>    $output .= "  </div>\n";
> 
>    if (!empty($admin)) {
>      $output .= "  <div class=\"admin\">\n";
>      $output .= $admin;
>      $output .= "  </div>\n";
>    }
>    $output .= $buttons;
>    $output .= "</div>\n";
> 
>    return $output;
> }
> ?>
> 
> But if I replace $output .= drupal_render($form); with
> 
> $output .= drupal_render($form['title']);
> $output .= drupal_render($form['body_field']);
> $output .= drupal_render($form['custom_select_field']);
> 
> Which are the only three I actually need to have displayed for a 
> non-admin, then the page will NOT save, [no errors, it just reloads the 
> page and erases all my changes]
> 
> Also, the function:
> 
> drupal_render()
> 
> Doesn't really give me much control over how to theme the sub-parts of 
> the form...
> 
> Can anyone help me to please give real class and/or id names to the 
> elements of the form?
> 
> Thanks!
> 
> Sebastian
> _______________________________________________
> themes mailing list
> themes at drupal.org
> http://lists.drupal.org/mailman/listinfo/themes
> 


More information about the themes mailing list