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 – replacing header area with template block


Carry out the following steps:

  1. Open elements/header.php from your theme in your text editor.

  2. Look for the following highlighted lines and remove all of them:

    <div id="wrapper">
    <div id="page">
    <div id="header_line_top"></div>   
    <div id="header">
    <?php
    $a = new Area('Header Nav');
    $a->display($c);
    ?>
    </div>
  3. Next, insert the following PHP code instead:

    <?php 
    $autonav = BlockType::getByHandle('autonav');
    $autonav->controller->orderBy = 'display_asc';
    $autonav->controller->displayPages = 'top';
    $autonav->render('templates/header_menu');
    ?>
  4. Save the file and reload your page. The header navigation is still there, but if you switch into edit mode, there's nothing you can edit in the header navigation.

What just happened?

By replacing the area with the small code above, we've put the autonav block directly into the template disallowing any modification in the user interface.

We...