know how to change the template of a page on the fly?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
archeo
Forum Members
Forum Members
Posts: 107
Joined: Tue Oct 21, 2014 12:47 pm
Location: Lorient (France)

know how to change the template of a page on the fly?

Post by archeo »

Hello,

I would like to use two different templates for the same page depending on where on the site the page is called. I did not find any matching parameters in the internal link tag.

If you have a link or a piece of code thank you in advance.
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1629
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: know how to change the template of a page on the fly?

Post by DIGI3 »

One method would be to have the page template just be something like:

Code: Select all

{if $smarty.server.HTTP_HOST == 'foo'}
  {include file='cms_template:template1}
{else}
  {include file='cms_template:template2}
{/if}
I don't know if there's a core method for actually switching the page template before it's loaded though. Would probably need a module.
Not getting the answer you need? CMSMS support options
Post Reply

Return to “CMSMS Core”