Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment #1
arcall CreditAttribution: arcall commentedJohn,
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
Comment #2
johntang CreditAttribution: johntang commented@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
Comment #3
yurgon CreditAttribution: yurgon commenteddont work for me
Comment #4
bipink8 CreditAttribution: bipink8 commentedjohn91tang ,
How to port this to Drupal 6 ?
Thanks,
Bipin
Comment #5
bipink8 CreditAttribution: bipink8 commentedI got it working in drupal 6,I added below code in page.tpl.php
Thanks,
Bipin
Comment #6
SpleshkaHi all,
Now ajax links are works using this code snippet (See this commit):