Page 1 of 1

two domains using the same content but different templates?

Posted: Wed Feb 09, 2011 9:16 am
by davids355
I watched a video by Matt Cutts last night about mobile sub-domains and it has inspired me to try and create such a thing for Shareworld.

My aim is to have a mobile version of the site: m.shareworld.co.uk that mobile devices will be redirected to.

With cmsmadesimple I figure that I would need two sets of file structure - one at shareworld.co.uk and one at m.shareworld.co.uk
and a single database - so each site has the same content, however, I want separate templates and separate style sheets.

I know that this can sort of be achieved by using a mobile css sheet and display: none, but I really want a much more unique mobile site - with a substantially different layout.

Basically I'm just wondering if anyone thinks this would be possible in any way??????

Re: two domains using the same content but different templat

Posted: Wed Feb 09, 2011 4:25 pm
by Wishbone
Use one template. Write a UDT to get the domain name into a variable, unless there already is a tag to get this info. Then:

{if $domain == 'm.shareworld.co.uk'}

{* template 1 stuff *}

{else}

{* template 2 stuff *}

{/if}

Re: two domains using the same content but different templat

Posted: Wed Feb 09, 2011 6:51 pm
by davids355
That makes sense. Thanks! Just a bit of a mission now as I have about 9 different templates.

Also, will that have much of an effect on the speed of the site?

Re: two domains using the same content but different templat

Posted: Wed Feb 09, 2011 9:44 pm
by Wishbone
I don't see it making much of a performance difference.

Re: two domains using the same content but different templat

Posted: Thu Feb 10, 2011 12:22 am
by davids355
Okim going to RT and implement this in the next few days. Thanks for the help! I mark this as solved but will still post back with results.