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 – using file attributes in the gallery


Include the file attributes in the gallery by following these steps:

  1. Create a new directory structure, each directory within each other: blocks, slideshow, templates, and ad_gallery.

  2. Create a new file called view.php which generates the HTML output. It's similar to the one we've created before but the structure is a bit different and we have to access more attributes:

    <div class="ad-gallery">
      <div class="ad-image-wrapper">
      </div>
      <div class="ad-controls">
      </div>
      <div class="ad-nav">
        <div class="ad-thumbs">
          <ul class="ad-thumb-list">  
          <?php 
          defined('C5_EXECUTE') or die(_("Access Denied."));
          
          foreach($images as $imgInfo) {
            $f = File::getByID($imgInfo['fID']);
            $fp = new Permissions($f);
            if ($fp->canRead()) {
          
              $fileName = $f->getFileName();
              $picturePath 	= $f->getRelativePath();
           ...