As per title, I want to add an introduction text right after the Login / Register Form's title. Can anyone point me into the right direction on this?


JordanMagnuson’s picture

Check out this guide: http://drupal.org/node/19855 . The relevant part, if you scroll down to the Drupal 7 section is adding your intro text variable like so:

$variables['intro_text'] = t('This is my awesome login form');

Then in your template file you can print it out:

<p><?php print $intro_text; ?></p>

<div class="my-form-wrapper">
  <?php print $rendered; ?>

Note that adding a template file for the registration form (which has no theme hook associated with it) requires an extra step. See the first step at http://www.beyrent.net/blog/2011/05/theming-drupal-7-user-registration-form

Hope that helps.

akmalfikri’s picture

Hi there!

Thanks for replying.

This works if we login via user/login. On the same time, the site also have a login in Modal Form box. But the text did not shown there. Can someone point to me for this?

JordanMagnuson’s picture

Hm... that's strange. The text shows for me in the modal as well as non-modal, so I'm not sure what to suggest.

alexweber’s picture

Since this module just renders the form in a modal I don't see why wou wouldn't be able to just use a hook_form_alter() to add the extra markup you want.

JordanMagnuson’s picture

Yes, using hook_form_alter() is probably the easiest way. Something like:

$form['some_text'] = array(
          '#type' => 'item',
          '#markup' => '<p>Some text</p>,
          '#weight' => -100,