How to add a custom link to login form block with hook_form_alter

How to add a link with custom path to my login block with hook_form_alter. I 've created a custom module but i dont know what to add to my hook_form_alter function.

Replay

In Drupal 7 you can use #markup attribute, as suggested by MOLOT


/**
 * Implements hook_form_alter()
 */
function hook_form_alter(&$form, &$form_state, $form_id) {
  switch ($form_id) {
    case 'user_login':
    case 'user_login_block':
      $form['link'] = array('#markup' => l(t('Link text'),'node'));
      break;
  }
}

Note:

Category: forms Time: 2014-01-13 Views: 1

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.243 (s). 12 q(s)