Jump to content

Different Themes on different cms pages


Recommended Posts

Hi there community,

 

i got a question where google couldn´t help me so i decided to ask you.

 

Can you tell me if it is possible to do different themes / layouts on different CMS Views / Pages.

 

A theme per CMS view?

 

I know that it is possible with categories and found instructions on how to do that but it seems there is no  information on how to do that for cms pages.

 

Any Ideas?

 

Thx a lot

Toby

Link to comment
Share on other sites

hello

 

it is possible to any part of your website, i described whole process here: http://www.prestashop.com/forums/topic/276596-different-product-page-for-one-of-products/

do the same for CMSController.php

 

instead of id_product just use id_cms 

if (Tools::getValue('id_cms')==2){
$this->setTemplate(_PS_THEME_DIR_.'my-new-cms-template.tpl');
} else {
$this->setTemplate(_PS_THEME_DIR_.'cms.tpl');
}

will work then as you want :)

  • Like 1
Link to comment
Share on other sites

Hey Vekia, thanks for your fast help. That nails the problem to 90%.

It changes everything excepting the navbar. We need different ways of navigation per CMS Page. Think this could not be done by the CMSController.php or am i wrong?

 

Thx

Toby

Link to comment
Share on other sites

Hey Vekia,

 

yes i mean the horizontal menu.

 

The links inside the module should be depending on the CMS Page you are.

 

Example: Startpage nav links: Link 1 - Link 2 - Link 3

 

On klick on Link 3 the nav links should be like: Link 4 - Link 5 - Link 6

 

You understand or should i describe better?

TY!!!

 

____ Forgot to tell: - I use a modified version of the default theme___

Edited by sm5k (see edit history)
Link to comment
Share on other sites

well, it is possible but it will be hard to achieve.

mainly because top horizontal menu doesnt allow to use links only on certain pages - and also doesnt allow to define several "types" of configuration.

 

you will have to modify module .php file, add some if conditions thich will check what kind of page you're browsing and then display - specific content. But in this case - whole link tree you will have to define manually.

Link to comment
Share on other sites

Hey Vekia,

 

which module .php do you mean i have to modify?

Could you please give me a small code example?

 

Than i think i could get it :)

 

Thanx a lot.

 

 

sorry but i don't know what you expect, you're talking about main case in this thread? if so, you have to edit cms controller located in controllers/front/CmsController.php file

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...