Dear all,
Usually in the user-login form, the controls are in thisorder: login input area, password input area, login button, lost passwordlink.
On the site I am working on and which uses a sub-theme of Zen, the order is: login input area, password input area, lost password link, login button.
It's a bit annoying to have the lost password link before thelogin button and I can' understand why this is so. I thought Zen was theming the user login form but apparently not. Well it does things with it but at the CSS level and that has no impact on the order of the controlsin the HTML page.
Any suggestion warmly appreciate.
Thanks, Shérab.
Hi Sherab,
To confirm if the theme is not changing the order of the form items, temporarily change the theme to bartik, and see if the items will be in order. If there are not in order, maybe some module is changing the order.
All the best
On 28 December 2014 at 17:46, Shérab Sebastien.Hinderer@ens-lyon.org wrote:
Dear all,
Usually in the user-login form, the controls are in thisorder: login input area, password input area, login button, lost passwordlink.
On the site I am working on and which uses a sub-theme of Zen, the order is: login input area, password input area, lost password link, login button.
It's a bit annoying to have the lost password link before thelogin button and I can' understand why this is so. I thought Zen was theming the user login form but apparently not. Well it does things with it but at the CSS level and that has no impact on the order of the controlsin the HTML page.
Any suggestion warmly appreciate.
Thanks, Shérab. -- [ Drupal support list | http://lists.drupal.org/ ]
Dear Mutuku,
Many thanks for your prompt response!
To confirm if the theme is not changing the order of the form items, temporarily change the theme to bartik, and see if the items will be in order. If there are not in order, maybe some module is changing the order.
I tried, thanks. The items are also not in the right order.
So as you say it must be something else than the theme. Any idea to continue the debugging?
Thanks! Shérab.
You can either start disabling contributed modules, or look in their source code for a {module_name}_form_alter (or {module_name}_form_{form_id}_alter) function to see if one of those is altering the weight of the elements.
Jamie Holly http://hollyit.net
On 12/28/2014 11:00 AM, Shérab wrote:
Dear Mutuku,
Many thanks for your prompt response!
To confirm if the theme is not changing the order of the form items, temporarily change the theme to bartik, and see if the items will be in order. If there are not in order, maybe some module is changing the order.
I tried, thanks. The items are also not in the right order.
So as you say it must be something else than the theme. Any idea to continue the debugging?
Thanks! Shérab.
Thanks Jamie for your hint. It indeed seems that CTools builds the user-login-form andlets other modules alter it. However, when looking at the code in user.module, function user_login_block, it seems this is all very declarative: all the widgets are declared as just members of an array, without any specific order. So I don't really know where the orderis calculated...
Thanks, Shérab.
If you have access to drush, you can use *drush hook form_alter* to find out all the form_alter hooks in your codebase.
On 28 December 2014 at 18:37, Shérab Sebastien.Hinderer@ens-lyon.org wrote:
Thanks Jamie for your hint. It indeed seems that CTools builds the user-login-form andlets other modules alter it. However, when looking at the code in user.module, function user_login_block, it seems this is all very declarative: all the widgets are declared as just members of an array, without any specific order. So I don't really know where the orderis calculated...
Thanks, Shérab. -- [ Drupal support list | http://lists.drupal.org/ ]
Hi,
If you have access to drush, you can use *drush hook form_alter* to find out all the form_alter hooks in your codebase.
Yes, I indeed have access to drush but the command didn't work.
Is there something special to install / enable for this command to work?
Also: as I understand it, building a formboils down to filling an array, which I believe is an orderless data structure. So I'm not sure whether looking at the hooks willhelp. Inmy understanding, the problem mayrather have to do with the part of the code that generates the markup based on the array. Any comment on this, please?
Thanks in advance! Shérab.
Could be in a custom module that does a form_alter hook to change the weights on the user_login form.. or perhaps the formdefaults module (which I believe can be used to alter form control weights). I'd be looking for custom module first (formdefaults is not that popular).
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of Shérab Sent: Sunday, December 28, 2014 6:46 AM To: support@drupal.org Subject: [support] Order of controls in user-login-form
Dear all,
Usually in the user-login form, the controls are in thisorder: login input area, password input area, login button, lost passwordlink.
On the site I am working on and which uses a sub-theme of Zen, the order is: login input area, password input area, lost password link, login button.
It's a bit annoying to have the lost password link before thelogin button and I can' understand why this is so. I thought Zen was theming the user login form but apparently not. Well it does things with it but at the CSS level and that has no impact on the order of the controlsin the HTML page.
Any suggestion warmly appreciate.
Thanks, Shérab. -- [ Drupal support list | http://lists.drupal.org/ ]