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 a page template


Carry out the following steps:

  1. Go back to the directory where you've created description.txt and create another file named default.php.

  2. Insert the content DIV along with some PHP code:

    <?php
    defined('C5_EXECUTE') or die(_("Access Denied."));
    $this->inc('elements/header.php');
    ?>
    
    <div id="content">
    <?php
    $b = new Area('Main');
    $b->display($c);
    ?>
    </div>
    
    <?php $this->inc('elements/footer.php'); ?>

What just happened?

Just like we did in the header, there's a line at the top to avoid direct calls and a few more lines of code to insert another editable area named Main. As you can see, the creation of the last file was also quite easy. There isn't a lot left from the original HTML code. However, having a small default.php file is also quite helpful, as we have to extend this file in case we need more page templates.