[support] how to Form Render-Alter in D7?

sebastian inforazor at gmail.com
Tue Oct 11 14:14:18 UTC 2011


Thanks Ted,

I've tried that and I get the following:

form < page < overlay < html

Form is what I want, as after that it is field-level.

It lists function:

theme_form()

http://api.drupal.org/api/drupal/includes--form.inc/function/theme_form/7

and candidate:

form()
[no other candidates listed]

with an array containing the $form and another that says:

'them_hook_suggestions' that is a null-array [no suggestions]
['them_hook_suggestions'] = null

Presumably I can't put theme_form() in my theme, I need to add a 
theme_hook_suggestion...?

If so, I guess my questions are:

1.) How can I add a suggestion to "look" at my theme?

and

2.) How to then access this function?

Presumably if 1.) is logical 2) will be answered at the same time.

Like if I could add the suggestion:

THEME_page_form_edit(&$form) {}

In case I am not clear, this is to edit the forms' theme for pages like:

node/edit
block/edit

in Drupal 7.

I hope I am still making sense.

Thanks for your help!

Best,

Sebastian.

On 2011-10-11 8:15 PM, Ted wrote:
> On 10/11/2011 1:34 AM, sebastian wrote:
>> The whole point of all this is I want to understand how I can not only
>> modify the form BEFORE it gets rendered, but also alter HOW the form is
>> rendered... wrap some parts in a DIV, maybe add a missing CLASS or ID etc.
> Try the devel_themer module.  When it is enabled, users with the proper
> permissions can click on any element and get information on all the
> theme functions used to generate that content, starting at the lowest
> nested level.
>
> Ted
>


More information about the support mailing list