Alter D7 login form

Events happening in the community are now at Drupal community events on www.drupal.org.
lrosete's picture

Hello. How do I alter the structure of the html inside the form tags of the user login form block in Drupal 7? I already got block--user--login.tpl.php to work which outputs the whole login form with "print $content". How do I output each element so I can control/re-arrange it. Thanks.

Comments

form_alter

primerg's picture

http://api.drupal.org/api/drupal/modules--system--system.api.php/functio...

use the weight for rearranging it. you can do whatever you want with any of the content if you use the form_alter

Thanks for the link/docs. But

lrosete's picture

Thanks for the link/docs. But it looks like I'm missing something. Any suggestions what I need to know first for this question? Or if you have an example, that would be great! Thanks again.

Try using a preprocess_block function

killer_tilapia's picture

Try using a preprocess_block function and put it in your template.php. Do something like:

function myThemeNameHere_preprocess_block(&$vars, $hook) {
       //alter the login form from here
}

I have the same problem.

Willysino's picture

Hi Irosete.
I also have the same problem.
And I don't understand +killer_tilapia, sorry.
I want to show and get the data into a table and need to get each one separately to work with them in different table cells.
But collided with the same problem as you "print $content".
Have you got any progress?
Thanks.

Philippines

Group organizers

Group categories

Post category

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: