By greta_drupal on
Okay, I give up. I've stared at it too long, and tried too many variations. A little help for this ASP coder, please?
Would like for this function to print all on 1 line:
function loginbar() { global $user; $output = ''; if (!$user->uid) { $output .= drupal_get_form('en_custom_login_block'); } else { $output .= t('<p class="user-info">Member: !user - </p>', array('!user' => theme('username', $user))); $output .= theme('item_list', array( l(t('Your account - '), 'user/'.$user->uid, array('title' => t('My account'))), l(t('Sign out'), 'logout'))); } $output = '<div id="user-bar">'.$output.'</div>'; return $output; }
Thank you!
Comments
...
Keep t() clean, text only, not likely we want class names etc translatable, I'd probably be more inclined to do it like this...
To get it all on one line is a CSS jobby...
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.
Thank you for the reply,
Thank you for the reply, Jeff.
All I really needed was to apply the CSS to get it all on 1 line; thanks for saving me those steps. I just thought it would be tidier to write out the HTML on one line. But, this will work fine.
http://ItsAboutTyme.com
...
You should not break a "sentence" like this. In French, for example, they put a space before a colon. (And there are other reasone, e.g., it's not always easy to translate a solitary word in a way that fits in differnet contexts.) So you better put it all inside the t() (with a placeholder for the username).
...
thanks mooffie, I'll definitely remember that, cheers.
Pimp your Drupal 8 Toolbar - make it badass.
Adaptivetheme - theming system for people who don't code.