two domains using the same content but different templates?

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

two domains using the same content but different templates?

Post 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??????
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: two domains using the same content but different templat

Post 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}
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

Re: two domains using the same content but different templat

Post 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?
Wishbone
Power Poster
Power Poster
Posts: 1368
Joined: Tue Dec 23, 2008 8:39 pm

Re: two domains using the same content but different templat

Post by Wishbone »

I don't see it making much of a performance difference.
davids355
Power Poster
Power Poster
Posts: 279
Joined: Fri Apr 04, 2008 10:08 am

Re: two domains using the same content but different templat

Post 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.
Post Reply

Return to “The Lounge”