Hi!

I'm not a programmer so I'm not sure if what I'm asking is possible or not.

I use the "String Overrides" module to change the wording of some parts of my site.

I also use "Login Toboggan" . . . sweet module!!!

However, I'd like to change the way the logged in block is laid out!

I also use the Util module and it's block which gives either "You are not logged in" or "You are logged in as..."

So Login Toboggan's "[username] | Log Out" becomes redundant.
I'd like to be able to configure where or not Login Toboggan's logged in block displays the logged in user's name or not.

I tried with String override to just hide the username but I guess since the username is not passed through t() string override can't touch it

Does that make sense? Or should I be asking the String Override folks to make String Overrides use Tokens instead of t()?


/**
 * Theme the loggedinblock that shows for logged-in users.
 */
function theme_lt_loggedinblock(){
  global $user;
  return check_plain($user->name) .' | ' . l(t('Log out'), 'logout');
}

For the moment I've changed the above section in logintoboggan.module to


/**
 * Theme the loggedinblock that shows for logged-in users.
 */
function theme_lt_loggedinblock(){
  global $user;
  return l(t('Log out'), 'logout');
}

But I don't know if that's good form or causes any kind of security issue though it does seem to work OK for what I want to do. .

Comments

hunmonk’s picture

Status: Active » Fixed

what you've done is close, but not quite right. in drupal, all theme_ functions are overridable by creating a properly named theme function in the theme(s) you're using.

so if your theme is named foo, then create a function in your theme called foo_lt_loggedinblock(), and put the same code in as your adjusted version of theme_lt_loggedinblock().

austintnacious’s picture

Thanks!

That worked a treat! And helped me understand a little more about how the whole thing works. . .

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.