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

can i use multiple templates?

(1/2) > >>

schwoortz:
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?

mr-fan:
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: ---<?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 } ?>
--- End code ---

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: ---<?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;;
}
?>
--- End code ---

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

Fisherman:
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

CaptainRob:
Go to "Change Settings" of a page, there you can choose for each page a template.

Fisherman:
Thanks!

Navigation

[0] Message Index

[#] Next page

Go to full version