change header logo based on domain

Cory Booth

Well-known member
So I have a site that could easily support two different groups of users.
I'd like to combine these two sites into a single forum and map their current domain names to the new site.

To this point I am good to go....

What I would like to do now is if the user enters the site using domain name XYZ.com have the logo on all the pages = 1.png

If the user enters the site using ZYX.com then have the logo = 2.png

Is there a method to do this?
 
There's no explicit method to do this, though in a template, you should be able to access {$_SERVER.HTTP_HOST} and do a conditional based on that.

Note that while just changing the logo based on the domain is fine, if you hide content (to make it look like 2 individual forums), you would need 2 licenses for that.
 
Here is complete code if you need it:

Admin CP -> Appearance -> Templates -> logo_block

Replace this code:

Code:
<img src="@headerLogoPath" alt="{$xenOptions.boardTitle}" />

with this:

Code:
<xen:if is="{$_SERVER.HTTP_HOST} == 'www.xyz.com'">
	<img src="path/to/1.png" alt="{$xenOptions.boardTitle}" />
<xen:elseif is="{$_SERVER.HTTP_HOST} == 'www.zyx.com'" />
	<img src="path/to/2.png" alt="{$xenOptions.boardTitle}" />
</xen:if>

Set the image paths appropriately.
 
Top Bottom