WebsiteBaker Support (2.8.x) > Templates, Menus & Design

I need the template switcher code

(1/7) > >>

tomhung:
OK... I've been developing a site with a couple different template options.  I haven't shown the customer (my bosses) the templates yet.  I would like to be able to send links to them for preview.  Thus I would like some code similar to http://addons.WebsiteBaker.org/pages/templates.php

I'm guessing this request goes to Klaus and Matthias....

Greg

oeh:
Hi there tomhung.

I think what you are loocking for is this.

could be of help, have a look  at his page ;-)

http://slink2.no-ip.info:82/wsb/pages/wb-ideas/test-pages/template-test.php

Regards
OEH

tomhung:
That is awesome!!!  But it's not what I need. 

I have highly customized templates specific to this site.  I would like the customer to be able to switch them without logging in and changing the DB entry.  The reason is that I want them to see the site with their content, logo, etc. 

I would like to be able to send them three links like this:
http://addons.WebsiteBaker.org/pages/templates.php?template=uccellini
http://addons.WebsiteBaker.org/pages/templates.php?template=reflection
http://addons.WebsiteBaker.org/pages/templates.php?template=kirche

but of my site!!
 

Vincent:
Hi Greg,

If I understand your problem correctly, I think I had the same wish, and did a lot of thinking about it.

Eventually I found this (somewhat complex) solution:


* I did 2 installations, one in the root, and one in root/wb.
* Then I adjusted the index files of all templates I wanted to show, so they would only show from menu level 2.
* I prepared one complete site in root/wb/
* with page cloner I copied all files of one 'site', so you get design 1 /page 1/page 2/page2b etc. And design2/ page1/page2/page2b etc. Each page needs to have its own template assigned
* in the root installation I made links to the wb -installation, like design 1, design 2 etc.
* So if you click on one such link, it will open the design with all content, starting from level page1, page2 etc. in a new window
It works.
Hope you understand my approach and hopefully it is of some help to you.
If someone has a better (faster) idea, let me know.

Regards,

Vincent

marathoner:
Insert the following snippet in the root directory index(.)php

if ($_GET['template']!="")
   if(file_exists(WB_PATH.'/templates/'.$_GET['template'].'/index.php'))
      define('TEMPLATE',$_GET['template']);

Now just call your page as:
http://www.domainname.com/index.php?template=simple

Beware that this is NOT persistent. I've been wanting to make use of session variables so that things like using different templates or different CSS can be persistent. If anyone out there knows how to use the WB session management to set and read a new session variable I'd like to know how to do this.

Navigation

[0] Message Index

[#] Next page

Go to full version