Roundcube Community Forum

Themes & Styling => Theme Releases => Topic started by: RickMeasham on April 18, 2009, 08:56:32 AM

Title: Dynamic theming based on domain
Post by: RickMeasham on April 18, 2009, 08:56:32 AM
While I could create one theme per domain and assign that to each user, it seems a little bit of overkill just to change the logo. (And I don't really want people to be able to select someone else's domain theme!) So instead I'd prefer to just load the logo from a PHP file rather than a static image.

How would I pass in the logged-in user's domain? (ie, it's not the domain they're looking at in their browser but the domain for the email account that matters)

<roundcube:button command=&quot;mail&quot; image=&quot;/logo.php&quot; alt=&quot;RoundCube Webmail&quot; width=&quot;165&quot; height=&quot;55&quot; />

Somehow I need to include the domain like image="/[email protected]" .. but (unless I'm very much mistaken) there's no way to nest tags.

I'm sure I can't be the first person to want to do this .. right?

Cheers!
Rick
Title: Dynamic theming based on domain
Post by: rosali on April 19, 2009, 01:01:18 AM

image=&quot;/logo.php?address=<roundcube:var name='session:username'/>&quot;


Notice: On the logon page $_SESSION['username'] is not initialized ...
Title: Dynamic theming based on domain
Post by: RickMeasham on April 19, 2009, 06:12:32 AM
Sorry, I don't understand. Are you saying I can nest tags?
Title: Dynamic theming based on domain
Post by: rosali on April 19, 2009, 06:14:15 AM
This little bit will give you the  l o g g e d  on username:

Title: Dynamic theming based on domain
Post by: RickMeasham on April 19, 2009, 08:13:22 AM
OK, tested it and you can't nest tags. Therefore I'm guessing you didn't read my question fully. The logo image is inside a tag. And you can't nest tags, so my questions still stands.

Note this code:
 

I want to change that image attribute to have the session:username included in it.
Title: Dynamic theming based on domain
Post by: rosali on April 20, 2009, 12:53:39 AM

" alt="RoundCube" />


Also you could check in logo.php $_SESSION['username'] and then decide on server side which image should be return by logo.php.

Is it this what you are asking for?