Follow these steps to create an auto-hide page list:
Create a new directory structure for our template:
blocks/page_list/templates/auto_hide
.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>
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: