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 block picture navigation template


  1. Copy the default autonav template concrete/blocks/autonav/view.php to blocks/autonav/templates/picture_nav.php.

  2. We have to modify a few lines in the new template, and the following snippet shows you the lines you have to modify:

    if (!$pageLink) {
    	$pageLink = $ni->getURL();
    }
    
    $navigationLinkOn = $navigationLinkOff = $ni->getName();
    $navigationPicOff = $_c->getAttribute('navigation_pic_off');
    $navigationPicOn = $_c->getAttribute('navigation_pic_on');
    if ($navigationPicOn) {
      $navigationLinkOn = '<img src="' . $navigationPicOn->getURL() . '" alt="' . $navigationLinkOn . '"/>';
    }
    if ($navigationPicOff) {
      $navigationLinkOff = '<img src="' . $navigationPicOff->getURL() . '" alt="' . $navigationLinkOn . '"/>';
    }
    	
    if ($c->getCollectionID() == $_c->getCollectionID()) { 
      echo('<li class="nav-selected nav-path-selected"><a class="nav-selected nav-path-selected" href="' . $pageLink . '"&gt...