Which trick consists of two separate forms of user registration on Drupal using different templates?

I have a default user registration form that cannot be changed. However, my boss wants a second registration form, which is laid out differently than the first. I'm new to Drupal, so some explanations will be great.

Thank you in advance

+3
source share
2 answers

If you are creating a custom module, you can define the path for the second menu item using hook_menu ().

function user_menu() {
  $items['user/custom_register'] = array(
   'title' => 'Create new account',
   'page callback' => 'drupal_get_form',
   'page arguments' => array('user_register'),
   'access callback' => 'user_register_access',
   'type' => MENU_LOCAL_TASK,
   'file' => 'user.pages.inc',
   );
   return $items;
 }

Of course, it will not look different than your existing form, it will just be a different path.

, , hook_form_alter() . page arguments , user_register .

+1

, . :

. , Drupal tpl , TPL style.css.

, :

http://www.lullabot.com/articles/hacking-phptemplate

, template.php tpl .

, , , "" "/", tpl ( ). , , . , , , , .

, ( ).

+1

Source: https://habr.com/ru/post/1749513/


All Articles