can i use multiple templates?

sky writer

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.


CaptainRob

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

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

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)

<?php 
// Submenu region, only shown when submenu's are available
ob_start();
show_menu2(1SM2_ROOT+1SM2_STARTfalse,'[li][a][menu_title]</a>','</li>''<ul>');
$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:


<?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 '<div id="content-breit">' page_content(1); echo '</div>'  //normal page content block 1
} else {
// here goes the HTML output if second content block has content!
echo '<div id="content-schmal">'page_content(1);
echo 
'</div><div id="rechts">' $rechts '</div>';
}
?>


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


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?