Book Image

concrete5 Beginner's Guide

Book Image

concrete5 Beginner's Guide

Overview of this book

Table of Contents (19 chapters)
concrete5
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – creating more page templates


Carry out the following steps:

  1. concrete5 themes usually ship with a few default templates, one of them usually named left_sidebar. Let's create it by copying default.php in a new file named left_sidebar.php.

  2. We're going to add two sub DIV elements to hold our left and main column:

    <?php
    defined('C5_EXECUTE') or die(_("Access Denied."));
    $this->inc('elements/header.php');
    ?>
    
    <div id="content">
    <div id="left-sidebar">
    <?php
    $as = new Area('Sidebar');
    $as->display($c);
    ?>
    </div>
    	
    <div id="main">
    <?php
    $b = new Area('Main');
    $b->display($c);
    ?>
    </div>
    	
    <div class="clear"></div>
    </div>
    
    <?php $this->inc('elements/footer.php'); ?>
  3. As we've added new HTML elements, we also have to insert a few more CSS rules in main.css, as follows:

    #left-sidebar {
    float: left; 
    width: 250px; 
    margin-right: 30px;
    }
    #main {
    float: left;
    width: 600px;
    }
    .clear { 
    clear: both; 
    }
  4. Let's create...