possible to apply different templates by user clicks?

Permalink
hi there,

have been asked to do a site at work where they want to have two different branding options - do you think this is possible?

Example:

On the nav they want to have two user paths (lets say person x and person y)

If you click on 'person x' all the pages will be in one template (lets say green) but if you click on 'person y' then all pages in the site will be in another template (lets say blue) - is this possible?

I really have no idea where to begin with this one, I guess to be passing some kind of value from one page to the next - but how do I then make this apply different templates?

Any ideas gratefully received!

 
ThemeGuru replied on at Permalink Reply
ThemeGuru
You can go to your site map and then setup to folders (person y and person x).

After that, right click the folder and click design. There you can change the template.

You might want to create a third template for system pages so that you can have a customized login page compared to the standard concrete5 one.

Hope that helps.

Thomas
monkeyboystu replied on at Permalink Reply
sorry yes I should have explained that better - I could do it as you suggest but then I would be duplicating content (ie a page for person y with template 1 and the same page duplicated for person x with template 2)

I was wondering if there is anyway of doing this dynamically to avoid the duplication?

Ie if some goes into the site from the 'person x' route, then from that point on a variable is passed to each page ensuring that the correct template is displayed

Cheers Stu
Mnkras replied on at Permalink Reply
Mnkras
you could do it, but it would require minor hacking, basically on view place a cookie based on the link, then the site changes based on the cookie
jbx replied on at Permalink Best Answer Reply
jbx
If you're able to perform all of your templates changes just with CSS, then you can use a session var to select which CSS file you load.

In your elements/header.php you could do something like
$_REQUEST['theme'] ? $_SESSION['theme'] = $_REQUEST['theme'] : null;
echo $_SESSION['theme'] == 'x' ? '<link rel="stylesheet" media="screen" type="text/css" href="' . $this->getStyleSheet('x.css') . '" />' : '<link rel="stylesheet" media="screen" type="text/css" href="' . $this->getStyleSheet('y.css') . '" />';


Obviously you would need to validate $_REQUEST['theme'], but that should get you started...
monkeyboystu replied on at Permalink Reply
perfect that sounds just what I was looking for!

Thank you very much!

(and yes should be able to do it with just the css)

Cheers :) :)