Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
I wanted to put some "subfields" in the right region but found it was not possible with the current code (maybe I missed that option ). But in fact it took 3 lines of code to make it possible ( was 2 before ), and I think this option can become quiet useful.
With that patch it's possible to do things like that:
function mycustom_module_form_alter(&$form, &$form_state, $form_id) {
...
$form["my_extra_field"]['#placement'] = array(
'region' => 'right',
'weight' => 3,
'has_required' => FALSE,
'hidden' => FALSE,
);
}
Things that become possible in hook_form_alter() with this:
- Assign region to form elements
- Move fields depending of the user role
- Move subfields :)
- ...
Comment | File | Size | Author |
---|---|---|---|
modules_assign_region.patch | 565 bytes | idflood |
Comments
Comment #1
pragnatek CreditAttribution: pragnatek commentedGreat patch, thanks for contributing.
I'm finding this very useful as my node forms are already greatly altered by using the inline_registration module and other customisations.
Thanks.
Comment #2
bachbach CreditAttribution: bachbach commentedthanks for this great simple patch.
Is this will be committed ?