Skip to content

Instantly share code, notes, and snippets.

@gebeer
gebeer / breadcrumbs.php
Last active August 29, 2015 14:09
ProcessWire Bootstrap 3 breadcrumbs snippet with microdata
<ol class='breadcrumb' itemprop="breadcrumb">
<?php foreach($page->parents as $parent): ?>
<li itemscope itemtype='http://data-vocabulary.org/Breadcrumb'>
<a href='<?php echo $parent->url; ?>' itemprop='url'>
<span itemprop='title'><?php echo $parent->title; ?></span></a></li>
<?php endforeach ?>
<li class="active"><?php echo $page->title; ?></li>
</ol>
@gebeer
gebeer / index.php
Created October 27, 2014 12:42
Modified index.php for [seb_map template](http://www.seblod.com/products/51) to allow autozoom to map markers
<?php
/**
* @version SEBLOD 3.x More ~ $Id: index.php sebastienheraud $
* @package SEBLOD (App Builder & CCK) // SEBLOD nano (Form Builder)
* @url http://www.seblod.com
* @editor Octopoos - www.octopoos.com
* @copyright Copyright (C) 2013 SEBLOD. All Rights Reserved.
* @license GNU General Public License version 2 or later; see _LICENSE.php
**/
@gebeer
gebeer / bs3CarouselMarkup
Last active April 14, 2017 08:18
Function to render Bootstrap 3 carousel markup from ProcessWire images object
// renders markup for a Bootstrap 3 Carousel from a ProcessWire images array
function bsCarouselMarkup($images) {
$carouselId = $images->get('page').$images->get('field')->id;
$carouselMarkup = "<div id='carousel-$carouselId' class='carousel slide' data-ride='carousel'>
<ol class='carousel-indicators'>";
$i = 0;
foreach ($images as $image) :
$class = ($i == 0) ? " class='active'" : "";
$carouselMarkup .= "<li data-target='#carousel-$carouselId' data-slide-to='$i'$class ></li>";
$i++;