3 Responses to Drupal: Add Log In / Log Out in Footer

  1. Abhinav says:

    Thanks !!! That was concise and simple…

  2. Bob says:

    That was exactly what I was looking for. Thanks for posting that!

  3. donSchoe says:

    Hi, thanks for your code.

    I’ve used it with some improvements:
    * use $base_path to make sure the login/logout button works on any of your drupal sites…
    * don’t add complex HTML into t()-strings
    * don’t add style information, that’s what a theme is for

    uid) {
    print '<strong>' . t('Hi @name!', array('@name' =&gt; $user-&gt;name)) . '</strong> | <a href="' . $base_path . 'logout" rel="nofollow">' . t('Logout') . '</a>';
    }
    else {
    print '<a href="' . $base_path . 'user" rel="nofollow">' . t('Login') . '</a>';
    }
    ?>

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>