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 »
  • Different page layouts in one template
  • Print
Pages: [1]   Go Down

Author Topic: Different page layouts in one template  (Read 10244 times)

Offline mikejd

  • Posts: 251
Different page layouts in one template
« on: June 17, 2014, 10:42:13 AM »
I don't know if this is possible - to have a number of different page layouts within one template. For example, single column or two column. I have done this on one or two sites but by using more than one template. Each template is more or less identical just with a different page layout. One template is set as default and the other can be selected for any page as required.

I am happy to carry on doing this but it does seem unnecessary to have to upload all the files for each layout every time.

cheers,
Mike
Logged

Offline Re-Mi

  • Posts: 97
Re: Different page layouts in one template
« Reply #1 on: June 19, 2014, 05:59:14 PM »
Hi,

This is possible (maybe in other ways ) but i use the a little trick i read somewhere here on the forum.

between the head tags i will place as many from these codes as i need

   <?php ob_start(); page_content(1); $content1=ob_get_contents(); ob_end_clean(); ?>
   <?php ob_start(); page_content(2); $content2=ob_get_contents(); ob_end_clean(); ?>

They will have to correspond with the content tags in the info.php for example:

in info.php

Code: [Select]
$block[1] = 'main content full with';
 $block[2] = 'main content half with';

in index.php

between the head tags:

Code: [Select]
<?php ob_start(); page_content(1); $content1=ob_get_contents(); ob_end_clean(); ?>
<?php ob_start(); page_content(2); $content2=ob_get_contents(); ob_end_clean(); ?>

And at the place you need it:


Code: [Select]
<?php if(($content2) == true){ ?>
<div class="main half">
<!--
<div class="main full">
-->
<?php } ?>
<?php page_content(1); ?>
</div>
<?php if(($content2) == true){ ?>
<div class="main half last">
  <?php page_content(2); ?>
</div>
<?php } ?>

and in the template.css you define the classes :

Code: [Select]
.main{
background: #FF00FF;
height: 500px;
}

.full {
width: 680px;
}

.half{
width: 335px;
float: left;
}

.last{
margin-left: 10px;
}



I think this should work, i did similar things with webpages i made, the above code i wrote as an example (and i think its correct, just try it) .

You should only change the blocks when you make the pages in the admin

p.s. don't judge my code  he he he i know i'm not a pro just trying to help out.

Greetz,

Michel
Logged

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Templates, Menus & Design »
  • Different page layouts in one template
 

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