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 an auto-hide page list


Follow these steps to create an auto-hide page list:

  1. Create a new directory structure for our template:

    blocks/page_list/templates/auto_hide.

  2. Within that directory, create a new view.php file. We don't have to copy the original default block template as we're only going to surround the existing template with a few elements as shown in the previous section.

    <div class="fixed-page-list<?php global $c; if ($c->isEditMode()) { echo '-edit'; } ?>">
      <div class="fixed-page-list-content">
        <?php 
        $bvt = new BlockViewTemplate($b); 
        $bvt->setBlockCustomTemplate(false);
    
        include($bvt->getTemplate());
        ?>
      </div>
      <div class="fixed-page-list-button">
        News
      </div>
    </div>
  3. Create another file called view.css. Our News button is going to be attached to the left border of the browser window. To do this, we have to add some CSS rules, as follows:

    .fixed-page-list {
       width:300px...