Login/Register customisations.. the Drupal Ninja way..

The challenge, to add a more dynamic, simple login/register to the site.. but how, there is the standard user login block.. will that cut it.. not really.. We want to have a message for people asking them to sign up, and telling them why, we want to make it easy.. what can we do?

Well the simplest way is to add a new block.. but then what's the code? how do we do this?
Well really it's just some text and some links for now.. yes, that would do it.. but we want to control whether they are shown if someone is logged in or not.. so we need to know if they are a user or not..

We think this is fairly easy.. so here's the final solution we use.. It's then easy to see how to extend this.

<?php global $user; ?>
<?php if ($user->uid) : ?>
Welcome: <?php print l($user->name,'user/'.$user->uid); ?> |
<?php print l("logout","logout"); ?>
<?php else : ?>
For full access to the site and to post messages, reviews and comments please <?php print l("Register","user/register"); ?> or <?php print l("Login","user/login"); ?>
<?php endif; ?>

The next step is to do more theming.. till the next lesson..stay sharp young ninja

re

I’ve been most successful using your last suggestion. Nothing else has worked. I’m unable to “stack” these for some reason, so I’d love to figure that out, but thanks for the tips so far college research paper

tags for Login/Register customisations.. the Drupal Ninja way..

To get the last Drupal Ninja Tips

Sign Up Below
First Name *
Email *

Recent comments