Closed (works as designed)
Project:
Drupal core
Version:
6.9
Component:
node.module
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
11 Feb 2009 at 22:20 UTC
Updated:
27 Aug 2011 at 17:40 UTC
Why my Save and Preview buttons are always in the middle of form?
See attachment.
It's quite annoying.
How I can move them to the end?
| Comment | File | Size | Author |
|---|---|---|---|
| Clipboard01.jpg | 55.56 KB | kenorb |
Comments
Comment #1
ainigma32 commentedYes that does look annoying ;-)
I would have to guess but it's probably a module that is messing with the weights of the different form elements.
See here http://api.drupal.org/api/file/developer/topics/forms_api_reference.html... for the API docs on the weight of form items.
You could use a hook_form_alter to set the weight of the buttons really high so the will 'sink' to the bottom.
Please post back how that works out for you.
- Arie
Comment #2
ainigma32 commentedLooks like kenorb won't be posting any feedback so I'm setting this to fixed.
Feel free to reopen if you think that is wrong.
- Arie
Comment #4
kenorb commentedIt always take me couple of weeks to get back to some issue:)
I'm not sure that changing weight of all field elements each time in form_alter is a not good solution.
Eventually it can be done only for Preview and Save and change it to last position.
I think there should be some solution to make it permanently.
Maybe there is some module, that do it?
Comment #5
dave reidCreate a small custom module that uses hook_form_alter to run this line:
$form['buttons']['#weight'] = 100;
You don't need to adjust the weights of all the fieldsets. Just make the buttons heavier.
Comment #6
kenorb commentedOk, that looks better.
I'll try this fix, but after some time when I'll back to it.
Maybe this high weight for buttons should be as standard in Drupal?
Comment #7
dpearcefl commentedIf this is a feature request, it will need to be made against D8.
Comment #8
mdupontOld issue. Closing. It is contrib modules' responsibility to ensure buttons are correctly displayed when they alter forms.