How to preview template?

Vincent

#17
Thanks, Ruud, for your answer.
I noticed that it does work in all browsers on my local testing server, so I guess it is a setting on my host.
I'll contact them.
Thanks again,

Vincent

Edit: I found out that you probably need php5. My account still used php4.

saiborg

Hi,

you can try the WebsiteBaker portable

http://www.websitebakers.com/pages/others/website-baker-portable.php

there you can do anything you want without any up and download

Saiborg
schaut doch mal vorbei

[url="http://www.microott.de"]http://www.microott.de[/url]

Ruud

It should work in all browsers, it is the server doing the "trick".

Look at your browser(s) setup(s)

It could be a caching "problem". Refresh pages with Ctrl-F5 to reload.
It could also be a cookie problem. The template is set in a session-cookie. If cookies are disabled the server will not "remember".

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Vincent

Hi,

This nice snippet works fine in IE7, but doesn't in most other browsers like IE6, Firefox, Opera or Safari - at least in my case. Sure, the first page displays properly in the right template (and remains in that template even after visiting other pages of the site), but the rest of the site is shows the template I chose in the admin settings.

Does anyone have a clue? :|

Thanks in advance,

Vincent

weiry

Thanks Rudd. Appreciate the answer. Exactly what I needed for a client.

Ruud

You should use:

www.yourdomain.com/pages/home.php?template=round
The ?template=round part can be added on any page in your website.

Ruud




[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

weiry

Thanks Rudd.

Appreciate the response. Forgive me for the questions, but is the domain name in the url www.yourdomain.com/home.php"template=round"

or how do it specify it in the url?

Cheers.

Ruud

using the name of the template (sub)directory. (Not the template name)

so for the round template, use template=round

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

weiry

#9
How do you specify the new template in the url?

Ruud

The template switcher solution here on the forum is one step further.

In your root index.php, just before the line $wb->get_page_details();, you can put this code snippet:

// Sticky Template switcher
if ($_GET['template']!="") {  // get the template to display from URL
   if(file_exists(WB_PATH.'/templates/'.$_GET['template'].'/index.php')) {
      define('TEMPLATE',$_GET['template']);
      $_SESSION['TEMPLATE']=TEMPLATE;
    }
} else {   // else get the template to display from Session Variable
    if(isset($_SESSION['TEMPLATE']) AND $_SESSION['TEMPLATE'] != '')
        define('TEMPLATE',$_SESSION['TEMPLATE']);
}


It first tests to be sure it is an existing template.
Next it is stored in a session variable, so next page will stay in the same template.
It works great.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Ale

Thank you all for your input.

I discovered a another way. The file class.frontend.php defines which template to use. I just added this code:


if(isset($_GET['template']))
   define('TEMPLATE', $_GET['template']);


Now I can give the template's name on URL and test it this way.

Ruud

Maybe the combination is the best solution ;-)

Do your template development on a XAMPP/WAMP server (like most of us do). That is convenient and faster editing and previewing.
If you really want to test first on your live server, use the template switcher solution for a live check.

Ruud
[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Stefek

@Ale

Yes, that's right.
For future Projects I advice you to set up a local installation first (whith all modules you will need), then to create your Template and then to create the Content on a live server.

With some experience you will find the "Golden Recipe" to bake your Websites with Webitebaker.

@Ruud -
this is another good advice. But  if you want to make more changes and also in the Module Files it cost more time, I guess.

Regards,
Stefek

[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Ruud

You could do a search here in the forum for "template switcher".

There are some solutions out there where you can switch just by using a parameter on the url.
You need to upload your new template with a different name/path and make a small change in your root/index.php.

That way you can view your complete site with any other template.

Ruud

[url=https://dev4me.com/modules-snippets/]Dev4me - WebsiteBaker modules[/url] - [url=https://wbhelp.org/]WBhelp.org[/url]

Ale

Ok thanks. That was exactly what I wanted to know.

The only downside of the method is that you must have 100% similar database and custom modules to view the template with similar content as in live web site.

Stefek

Hello!
The best way to do this, is a local installation with xampp.

After you made all your changes, you can upload the template again to the live server.

Regrads,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

Ale

I'm about to make some major changes to my page template. Is it possible to somehow privately preview the template in the admin section, while retaining the old template for anyone who visits the public pages? This way I could make some final touches to the template while seeing the real page content, but anyone else who visits the page would still see the old one.