Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/05/2012 in all areas

  1. This module goes through all of your /site/assets/files/ directories and removes those that have no files in them. http://modules.proce...ean-empty-dirs/ Pages with file/image fields require a directory, so you should expect that some of the removed directories will be re-created by these pages. As of today, ProcessWire no longer creates directories for all pages, so this module is mostly useful to existing sites rather than future sites. I am listing it as "alpha" just because I've only tested on my own sites. Once I get confirmation from others that it also worked well for them, I will change its status to stable. Until it is considered stable, I suggest only running it in dev/test environments (not that it does anything dangerous, but just a good practice).
    1 point
  2. Thanks apeisa! It seems I understand this somewhat better now with the examples. Will try this on a couple of sites I'm going to convert from Textpattern to ProcessWire.
    1 point
  3. If you are interested, I am trying about similar approach in my module Render::, which is currently in the 'proof of concept' phase.
    1 point
  4. Sure, actually will add one of these into first example. But here are both: Carousel.php <?php /* Generates the markup for the frontpage carousel */ if (count($carouselPages) < 1) return; echo "<div id='carousel'><ul class='rslides'>"; foreach($carouselPages as $key => $p) { echo "<li class='c-item c-item-$key'>"; echo "<img src='".$p->image->getThumb('carousel') ."' alt='' />"; echo "<p>$p->summary</p>"; echo "<a class='button' href='{$p->link->url}'>$p->headline</a>"; echo "</li>"; } echo "</ul></div>"; items.php <?php if (isset($title)) echo "<h2 class='items-title'>$title</h2>"; echo "<div class='items'>"; foreach($items as $key => $p) { $key++; if ($key > 3) { $key = 1; echo "<hr class='padding' />"; } echo "<div class='col{$key}of3 item'>"; echo "<img src='". $p->featured_image->getThumb('thumbnail') ."' alt='' />"; echo "<h2 class='title'><a href='$p->url'>$p->title</a></h2>"; echo "</div>"; } echo "</div>"; And as additional bonus, items-with-description.php (it includes the items.php from above): <?php if (count($items) < 1) return; $items = $items->slice(0,3); include('./items.php'); echo "<div class='col1-2of3'><p>$description</p></div>"; echo "<div class='col3of3'><a class='button block' href='$url'>$linkTitle</a></div>"; Uh, just realized that my site has evolved a little. Those in my example actually use "items-with-description.php" instead of just "items.php". There is also my "default-masthead.php": <?php $img = $image->width(304); ?> <div class='col1-2of3'> <h1><?= $title ?></h1> <p class='summary'><?= $summary ?></p> </div> <div class='col3of3'> <img src='<?= $img->url ?>' alt='' /> </div>
    1 point
×
×
  • Create New...