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,
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?
Comments
Comment #1
JordanMagnuson CreditAttribution: JordanMagnuson commentedCheck 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:
Then in your template file you can print it out:
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.
Comment #2
akmalfikri CreditAttribution: akmalfikri commentedHi 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?
Comment #3
JordanMagnuson CreditAttribution: JordanMagnuson commentedHm... that's strange. The text shows for me in the modal as well as non-modal, so I'm not sure what to suggest.
Comment #4
alexweber CreditAttribution: alexweber commentedSince 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.
Comment #5
JordanMagnuson CreditAttribution: JordanMagnuson commentedYes, using hook_form_alter() is probably the easiest way. Something like:
Comment #6
oksana-c CreditAttribution: oksana-c as a volunteer commentedJust like alexweber said above - this functionality is usually installed in template.php from current theme via hook_form_alter.
Marking this issue as "Closed (won't fix)" as this functionality should be achieved with other means than "Modal forms (with ctools)" module.
Code snippet below shows how to use hook_form_alter: