WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.8 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • can i use multiple templates?
  • Print
Pages: [1]   Go Down

Author Topic: can i use multiple templates?  (Read 6813 times)

schwoortz

  • Guest
can i use multiple templates?
« on: April 08, 2010, 06:08:15 PM »
I'm about to do a site where the designer has created at least 3 different page types (layouts, like two columns, three colums and smething completely different) so that I need more than ONE template in WebsiteBaker. Is this possible (within one theme)? Actally the person who writes pages needs to choose from 3 different templates...

I kind of doubt it, as there is ohnly one index.php an no option to choose a template when addind a new page.

Any ideas anyone?
Logged

mr-fan

  • Guest
Re: can i use multiple templates?
« Reply #1 on: April 08, 2010, 07:15:59 PM »
You could use different page_content() Blocks and check if they have content then view specific Layout or HTML...

little example with a simple submenu (found somewhere in the forum i think it was ruud some time ago)

Code: [Select]
<?php 
// Submenu region, only shown when submenu&#39;s are available
ob_start();
show_menu2(1, SM2_ROOT+1, SM2_START, false,&#39;[li][a][menu_title]</a>&#39;,&#39;</li>&#39;, &#39;<ul>&#39;);
$childmenu=ob_get_contents();
ob_end_clean();
if (
$childmenu!="") {?>

<div id="submenu">
<?php echo $childmenu; ?>
</div>
<?php } ?>

there is also a german tutorial here with the same function but it use page_content(x) for check...

http://www.beesign.com/WebsiteBaker/pages/posts/vier-in-einem-das-variable-template20.php

i will try to translate the code for you:

Code: [Select]
<?php 
// start buffer -> write contentblock/menu or other stuff -> put it in a variable
ob_start();
page_content(2);
$rechts=ob_get_contents();
ob_end_clean();
if (
$rechts =="") {
//ceck if this contentblock (2) has content ->that your autor create in the backend and set this content to the reffered block
echo &#39;<div id="content-breit">&#39; page_content(1); echo &#39;</div>&#39;  //normal page content block 1
} else {
// here goes the HTML output if second content block has content!
echo &#39;<div id="content-schmal">&#39;; page_content(1);
echo &#39;</div><div id="rechts">&#39; . $rechts . &#39;</div>&#39;;
}
?>

You could create a block (info.php) called "thirdcolum" and if this colum ("contentblock") is used then the HTML needed for this colum + the page_content(x); is displayed on this page......

I hope you'll see what i basicly mean?

this works good for additional colums or contentblocks or menus but not for complete layout changes......then the multi template methode is much better as 3 pressed different layouts in one.... :wink:

regards
martin

Logged

Offline Fisherman

  • Posts: 45
Re: can i use multiple templates?
« Reply #2 on: April 12, 2012, 11:37:19 PM »
I know this is an old thread but I also need to do this. Will the new version handle multiple templates? I have to do a cms for a website that has 4 page layouts and it's 11 years old. Check it out. www.labiche.com
Logged

Offline CaptainRob

  • Posts: 118
  • Gender: Male
Re: can i use multiple templates?
« Reply #3 on: April 13, 2012, 12:57:27 AM »
Go to "Change Settings" of a page, there you can choose for each page a template.
« Last Edit: April 13, 2012, 07:43:29 AM by CaptainRob »
Logged

Offline Fisherman

  • Posts: 45
Re: can i use multiple templates?
« Reply #4 on: April 13, 2012, 01:14:22 AM »
Thanks!
Logged

Offline sky writer

  • Posts: 926
Re: can i use multiple templates?
« Reply #5 on: April 13, 2012, 02:06:48 AM »
I checked out your current site.  I might be wrong, but I don't think this design would require different templates for each page.  It's the same basic layout, it would just require some specific show_menu2 and section/block settings to make it work.
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • can i use multiple templates?
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2