Resolved Different side column per domain

ibaker

Verified Customer
#1
I have a template that contains advertisers called "advertisers" and it is pulled up in many different places on my main site (forums main list, New Posts, Search page etc) with the code:
Code:
<xen:include template="advertisers" />
What I need to do is have a different advertisers template pulled up with the different domains...I tried to play around with the content replacement function per domain but couldn't get it to work.

What I need to do is display different adverts for each domain so can you advise which is the best way to do this...thanks
 

XenCentral

XenCentral Support
Staff member
#2
Hello, @ibaker

Using template inclusion directly builds the content into the parent template, so it does not allow to dynamically change that template in any way. However, instead of actual content of ads you could just have an empty hook in that template, and use our product to add content to that hook using content replacements. You can specify template name when adding content, so your main template would just contain
HTML:
<xen:hook name="custom_ad_hook" />
and you can have advertisers_domain1, advertisers_domain2 etc. templates added to that hook.

Let us know if you have any other questions.

Thank you!
 

ibaker

Verified Customer
#3
Thank you...I changed the template include code to a hook and then in the Manage Sites settings for first domain I entered:
Append To => Advertisers_hook
Render Template => advertisers

For 2nd domain I entered:
Append To => Advertisers_hook
Render Template => advertisers_AUS

So each domain pulled up a different template...Thanks
 

XenCentral

XenCentral Support
Staff member
#4
Thank you...I changed the template include code to a hook and then in the Manage Sites settings for first domain I entered:
Append To => Advertisers_hook
Render Template => advertisers

For 2nd domain I entered:
Append To => Advertisers_hook
Render Template => advertisers_AUS

So each domain pulled up a different template...Thanks
That's nice it worked for you. Let us know if you have any other questions.

Thank you!
 

ibaker

Verified Customer
#5
Thinking about this in a more global sense, I was wondering about the use of separate styles for each domain instead of using the above method.

I know it can be a pain doing any template edits when you have many different styles as each edit update takes a long time to save so I am wondering which method, using different styles or the Content Replacement function, would have the better site performance...a lot of my users have very slow internet connections
 

XenCentral

XenCentral Support
Staff member
#6
Thinking about this in a more global sense, I was wondering about the use of separate styles for each domain instead of using the above method.

I know it can be a pain doing any template edits when you have many different styles as each edit update takes a long time to save so I am wondering which method, using different styles or the Content Replacement function, would have the better site performance...a lot of my users have very slow internet connections
Content replacement method, especially with append/prepend mode does not affect site performance at all, just renders another template, like many addons and the core do. As for slow connections of users, you should note that any performance impact is only on server level, not client-side, so the method used will not make any difference for users depending on their connection speed, as long as they get the same final data (e.g. the same ads).

Thank you!
 
Top