Please. Hold on for a second. (was Re: [development] proposal for theming nodes)

vlado vlado at dikini.net
Thu Dec 15 11:35:38 UTC 2005


Me being a dummy, just to verify I understand this right

> $node->extras['module_something'] = array('#type' => 'form_box,  
> '#value' => $module->something, '#default_value' => 'lorem ipsum  
> ferrets and mounties and bubbles and things');

> <?php form_render($extras['module_something'); ?>

The key to this is the #type - if I want to provide some custom,
non-form types, can I use #vlados_secret_passion ?


> By default render function uses either the order specified, or the  
> #weight property you add.

> The only requirement is that you need to only have 1 parameter for  
> the theme function (an associative array).
> You can re-use any theme function you want by just adding a small  
> wrapper function, like such :

> function theme_form_box($form) {
>    return theme_box($form['#title'], $form['#value'] . $form 
> ['#children']);
> }
theme_vlados_secret_passion($form) - not nessesarily theming a form element, 
just a theme function





More information about the development mailing list