Hi, I would like to develop a theme that look different depending on whether the user is logged in or not. I want to enact these changes by changing stylesheet. Though I could hardcode the stylesheet tag into the template, I was wondering if there was a more elegant way of doing this, ie using the $styles var in the template?

Comments

shyamala’s picture

check out thread http://drupal.org/node/140587
http://shyamala-drupal.blogspot.com/

Shyamala
Technology Head - Drupal Competency Center
Netlink Technologies Ltd.

keirlawson’s picture

Hi,

Thanks for your swift reply, however neither of those solutions offer a nicer solution than what I was already proposing as far as I can see...

shyamala’s picture

Sorry I inserted my blog url by mistake on the previous post. You are using Drupal 6 is it. Yup I cannot think of anything else.
Shyamala
Technology Head - Drupal Competency Center
Netlink Technologies Ltd.

prestonso’s picture

There's no way to change how a theme displays to a logged-in user or a non-logged-in user through the CSS. The option suggested above works fine to that end, or you can also assign an id or a class to the body based on whether the user is logged in or not, styling everything based on inheritance of that id or class. Apart from the body definition or defining certain other elements, there is no more "elegant" way of doing what you want.
___________________

Preston So
Web/Print Designer
Monarch Digital, Colorado Springs
My near-dead non-Drupal site

___________________

Preston So

yuriy.babenko’s picture

When a user is logged in, the <body> tag has the CSS class 'logged-in'.

---
Yuriy Babenko
www.yubastudios.com
My Drupal tutorials: http://yubastudios.com/blog/tag/tutorials

---
Yuriy Babenko | Technical Consultant & Senior Developer
http://yuriybabenko.com