Roundcube Community Forum

 

Dynamic theming based on domain

Started by RickMeasham, April 18, 2009, 08:56:32 AM

Previous topic - Next topic

RickMeasham

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

rosali


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


Notice: On the logon page $_SESSION['username'] is not initialized ...
Regards,
Rosali

RickMeasham

Sorry, I don't understand. Are you saying I can nest tags?

rosali

This little bit will give you the  l o g g e d  on username:

Regards,
Rosali

RickMeasham

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.

rosali



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?
Regards,
Rosali