0
votes

I need help with this, I want to have an url like this: "mysite.com/catalog/login" that should shows a different login template not like the common D7 login page: mysite.com/login ...

I been spending time creating blocks that not render the php function: drupal_render() and using some preprocess functions in the template.php

2
At the end I used the themeKey module, created some pages with and specific URL, and added blocks to this URL's. This lines really help me to: codemodule_load_include('inc', 'user', 'user.pages'); $elements = drupal_get_form('user_pass'); codeKenneth Bregat

2 Answers

0
votes

You could use drupal_render(drupal_get_form('user_login_block')); on a seperate page from the standard /user page like your /catalog/login.

You could also modify that form (e.g., change some fields, add attributes like additional classes for styling, etc) using the form alter hook like MYMODULE_form_user_login_alter(&$form, &$form_state, $form_id) { }.

It depends a bit on whether you are just intending to render the login form in a different location or whether you want to change it significantly. It is also possible to login a user programmatically from a form you make yourself. Here is a stackoverflow response with more details on how to do that: https://drupal.stackexchange.com/questions/5825/how-do-i-programmatically-log-in-a-user

0
votes

The only way to do that is to write a custom module. You'll have to override the menu path for /user and set it to access denied.

More info here: https://groups.drupal.org/node/20925