my code stock.com

Daniel Zas

DRUPAL 7 - Crear tpl para formulario de login y registro
by Daniel Zas

Snippet options

Download: Download snippet as drupal-7-crear-tpl-para-formulario-de-login-y-registro.php.
Copy snippet: For this you need a free my code stock.com account.
Embed code : You will find the embed code for this snippet at the end of the page, if you want to embed it into a website or a blog!

/*ESTE CODIGO SE INCLUIRÍA EN EL TEMPLATE.PHP DEL TEMA*/

/*Establece tpl para pagina de login*/
function saniyou_theme() {
  $items = array();


    
  // create custom user-login.tpl.php
  $items['user_login'] = array(
  'render element' => 'form',
  'path' => drupal_get_path('theme', 'saniyou') . '/templates',
  'template' => 'user-login',  // Habria que crear una tpl dento de la carpeta templates del tema llamado user-login.tpl.php
  'preprocess functions' => array(
  'saniyou_preprocess_user_login'
  ),
 );
 $items['user_register_form'] = array(
  'render element' => 'form',
  'path' => drupal_get_path('theme', 'saniyou') . '/templates',
  'template' => 'user-register-form', // Habria que crear una tpl dento de la carpeta templates del tema llamado user-register-form.tpl.php
  'preprocess functions' => array(
  'saniyou_preprocess_user_register_form'
  ),
 );
return $items;
}

/*EL CODIGO BÁSICO PARA RENDERIZAR TODO EL FORMULARIO DE LOGIN O DE REGISTRO DENTRO DEL TPL SERÍA EL SIGUIENTE:

  <?php render($page['content']['metatags']); ?>
  <?php print drupal_render_children($form) ?>
*/

Create a free my code stock.com account now.

my code stok.com is a free service, which allows you to save and manage code snippes of any kind and programming language. We provide many advantages for your daily work with code-snippets, also for your teamwork. Give it a try!

Find out more and register now

You can customize the height of iFrame-Codes as needed! You can find more infos in our API Reference for iframe Embeds.