Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 01:26:03 AM

Login with username, password and session length
Search:     Advanced search
Wollen Sie dem WebsiteBaker Team beitreten?
Nähere Informationen finden Sie unter hier und auf unserer neuen Webseite.
155555 Posts in 21715 Topics by 7737 Members
Latest Member: gx-world
* Home Help Search Login Register
Pages: 1 [2]   Go Down
Print
Author Topic: I need the template switcher code  (Read 8337 times)
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #25 on: February 13, 2011, 11:13:02 PM »

That block does not do the switching, it is just a list that will use the function I pointed yo you.

The list will not work properly in WB2.8.x because now there are also backend themes.
The list could created manually just like any other form that uses a select (method GET).

First start with the code for the index.php. Try to see if it works by typing on the addressbar website.com?template=round.
If that works, you could think of the next step..
Logged

Professional WebsiteBaker Solutions
ufferichter

Offline Offline

Posts: 36


WWW
« Reply #26 on: February 15, 2011, 03:45:39 PM »

If it so, that the list will not work properly in WB2.8.x, i think this is a petty, i will hope that will be possible to make a solution with dropdown box, every cms have it.

If any can make a template switcher in a dropdownbox, that will be great
Logged

Regards Uffe

websitebaker.dk
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #27 on: February 15, 2011, 03:53:45 PM »

You can just create the dropdown manually..

I do not assume you add many templates on a regular basis.. So the list using the templates you want to offer to the visitors should not have to be "generated".
Logged

Professional WebsiteBaker Solutions
ufferichter

Offline Offline

Posts: 36


WWW
« Reply #28 on: February 16, 2011, 08:19:46 PM »

Hi Ruud

Ok i try to listen after now!

I incert the chances in index.php on my testsite, and try to call this url http://testzone.uffe.it/?template=round and the template was chance allright.,., please note that not the official site og websitebaker in Denmark, but only where i am testing!

What i am doing next to make a dropdown manualy.
Logged

Regards Uffe

websitebaker.dk
ufferichter

Offline Offline

Posts: 36


WWW
« Reply #29 on: February 20, 2011, 10:49:45 PM »

Ruud, are you still with me?
Logged

Regards Uffe

websitebaker.dk
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #30 on: February 21, 2011, 10:26:17 PM »

I had the impression it would be clear now.
Create a small form somewhere in your template (where you want it to show up) that creates the links to another template.
Code: (Untested example)
<form name="myform" method="get" action="">
  <select name="template" onchange="javascript: document.myform.submit();">
    <option value="round">The nice Round template</option>
    <option value="allcss">Only using CSS</option>
    <option value="someother">Some other template</option>
  </select>
</form>
Replace the option values by your installed template directory names.
Logged

Professional WebsiteBaker Solutions
ufferichter

Offline Offline

Posts: 36


WWW
« Reply #31 on: February 22, 2011, 12:43:44 AM »

Hi Ruud

Yes its working, but have to install the form on every theme you wanna to show, i cant understand there not a a modul there is working all over.

But Ruud, i got a problem now, i was not thinking, so i choose the theme argos_theme, and now my site is gone, i have tryed to find the cookie but no luck, and remove my my old ie temp file, do you have a solution..
Logged

Regards Uffe

websitebaker.dk
Ruud
WebsiteBaker Org e.V.

Offline Offline

Posts: 2298



WWW
« Reply #32 on: February 22, 2011, 10:16:12 AM »

Adding it to each template is one option. The discussion earlier in this tread was to put it in your main index.php.
The problem there is that you cannot tell where the dropdownlist will show up in the selected template.
Since the template switcher is a modification in the core files it makes no sense to create a module for it. The module would not function without modifying the core files.

The theme is stored in a session, so if you close your browser (all instances) and retry with a new browserwindow it should show your original template again.
Logged

Professional WebsiteBaker Solutions
ufferichter

Offline Offline

Posts: 36


WWW
« Reply #33 on: February 25, 2011, 02:12:17 AM »

Hi Ruud

Yes i understand, but i must say, its not the prober solution for me, and if its not possible to make a modul for that, i must say, its a petty...

But thanks for helping me...
Logged

Regards Uffe

websitebaker.dk
Boudi
Addon Team

Offline Offline

Posts: 816



WWW
« Reply #34 on: September 07, 2011, 01:40:20 PM »

Easiest way is:

create some templates (eg: yellow, red)
create some homepages (eg: home_yellow, home_red)
link every homepage to it's own template
Place in every index.php from each template a pulldownmenu like:

HEAD:
Code:
<SCRIPT TYPE="text/javascript" LANGUAGE="JavaScript">
<!--

function openURI() {
var control = document.name.templates;
if (control.options[control.selectedIndex].value != '') {
location.href = control.options[control.selectedIndex].value;
}
}

//-->
</SCRIPT>

BODY:
Code:
<FORM ACTION="" NAME="name">
<SELECT NAME="templates" onchange="openURI()">
<OPTION VALUE="home_yellow.php" selected="selected">Template 1</OPTION>
<OPTION VALUE="home_red.php">Template 2</OPTION>
</SELECT>
</FORM>

Don't forget to change the SELECTED into the template that is show at that moment.
« Last Edit: September 08, 2011, 09:33:01 PM by Boudi » Logged

...:: Bake the Unbakable ::...
Pages: 1 [2]   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!