1

Is there a way to add a message above the Registration Form?

I know you can edit the field by going to "Configuration/People/Account Setting/Manage Field", but how about a message above the form?

Thanks

3 Answers 3

3

The simplest way would probably be to create a block that is only displayed for that page, and position it above the content.

1
  • OMG, i forgot about the "block". TY @Graham :)
    – CocoSkin
    Mar 14, 2014 at 19:14
1

You could do that with hook_form_FORM_ID_alter() in a custom module:

function mymodule_form_user_register_form_alter(&$form, &$form_state, $form_id) {
  $form['#prefix'] = '<div><p>'. t('Add your message here'). '</p></div>';
}

Read also Customizing and Overriding User Login page, Register, and Password Reset in Drupal 6 and 7 : another way to add your message and whatever you'd like:

Customizing the user login, register, and password reset pages is fairly simple, and uses the following concepts:

  • preprocessing to set variables
  • registration of functions in the theme registry
  • creation of one or more theme templates.
0

You can also use markup like this

<?php

 function first_admin_setting_form($node, &$form_state) {
      $form = array();
      $form['overview'] = array(
        '#markup' => t('Interface for setting for first module'),
          '#prefix' => '<h4>',
          '#suffix' => '</h4>',
        );
?>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.