Hello,

You can show login, register or request new password link on everywhere. Using code:

$enabled_links = variable_get('ajax_register_enabled_links', array('login', 'register', 'password')); 
$print_link= array(
 '#theme' => 'item_list',
 '#items' => _ajax_register_ajax_links($enabled_links),
 '#attributes' => array('class' => array('ajax-register-links'))
);
print render($print_link);

- setting enabled_links variable array you want to show the links. for ex: array('login')
- You can put it on page.tpl.php or everywhere.

Enjoy!

John

Comments

arcall’s picture

John,
I have tried to add your code in a block (php mode), and their is all kind of error. Perhaps the ctools and ajax_register function aren't accessible from the blocks ? any ideas how I can fix it ?
Thanks

johntang’s picture

@arcall

Now I still no way to fix it, but I have sollutions for you:

You can disable (comment with '//') the functions of error on ctools (ctools/includes/) and copy this functions to sites/default/settings.php in here this functions is global :)

I don't know why Drupal no see the some functions of the ctools on customize page :)

Regards

John

yurgon’s picture

dont work for me

bipink8’s picture

john91tang ,

How to port this to Drupal 6 ?

Thanks,
Bipin

bipink8’s picture

I got it working in drupal 6,I added below code in page.tpl.php

 $attributes['class'] = $attributes['class'].' thickbox';
                                $login_uri = l(t('Login'), 'ajax_register/login',array('attributes'=>$attributes,'query'=>$query));
                                print $login_uri;

Thanks,
Bipin

Spleshka’s picture

Hi all,

Now ajax links are works using this code snippet (See this commit):

$enabled_links = variable_get('ajax_register_enabled_links', array('login', 'register', 'password'));
$print_link= array(
  '#theme' => 'item_list',
  '#items' => _ajax_register_ajax_links($enabled_links),
  '#attributes' => array('class' => array('ajax-register-links'))
);
print render($print_link);