Skip to content

Instantly share code, notes, and snippets.

/* The Grid ---------------------- */
.lt-ie9 .row { width: 940px; max-width: 100%; min-width: 768px; margin: 0 auto; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row.large-collapse .column,
.lt-ie9 .row.large-collapse .columns { padding: 0; }
.lt-ie9 .row .row { width: auto; max-width: none; min-width: 0; margin: 0 -15px; }
.lt-ie9 .row .row.large-collapse { margin: 0; }
.lt-ie9 .column, .columns { float: left; min-height: 1px; padding: 0 15px; position: relative; }
.lt-ie9 .column.large-centered, .columns.large-centered { float: none; margin: 0 auto; }
@jamiepittock
jamiepittock / gist:8579243
Last active January 4, 2016 05:59
Unique venues
{exp:stash:set_list name="venues" parse_tags="yes" parse_conditionals="yes" trim="yes"}
{exp:channel:entries channel="events" dynamic="no" show_future_entries="yes"}
{if cf_events_place}
{stash:venue_title}{cf_events_place}{title}{/cf_events_place}{/stash:venue_title}
{stash:venue_id}{cf_events_place}{entry_id}{/cf_events_place}{/stash:venue_id}
{/if}
{/exp:channel:entries}
{/exp:stash:set_list}
<select>
@jamiepittock
jamiepittock / gist:9749399
Last active August 29, 2015 13:57
Better Meta overrides
// Global template
{exp:nsm_better_meta:template}
// Page template
{embed="_embeds/start"
entry_id="{entry_id}"
description="Bar"
}
@jamiepittock
jamiepittock / craftblockwrap.twig
Created February 2, 2018 21:58 — forked from Chrisedmo/craftblockwrap.twig
Craft CMS matrix blocks intelligent wrapping
{# _partials/blocks/blocks.html #}
{#
Blocks component
Outputs a matrix field blocks, intelligently wrapping blocks that need to be inset from the edges
@param {object} contentBlocks (MatrixBlockModel)
#}
{# Parameters #}
<?php
// Stripped down for brevity
class BPlugin {
public function init () {
// Trigger Google Shopping updates
// =====================================================================
if (!craft()->config->get('devMode')) {
@jamiepittock
jamiepittock / fullNameToFirstName.php
Created November 24, 2022 10:46 — forked from stilliard/fullNameToFirstName.php
PHP - Get a users first name from the full name
<?php
/**
* Get a users first name from the full name
* or return the full name if first name cannot be found
* e.g.
* James Smith -> James
* James C. Smith -> James
* Mr James Smith -> James
* Mr Smith -> Mr Smith
@jamiepittock
jamiepittock / CollapseSidebarAsset.php
Created February 21, 2024 08:50 — forked from wsydney76/CollapseSidebarAsset.php
Make sections of Craft 5 element indexes collapsible
<?php
namespace modules\main\web\assets\collapsesidebar;
use craft\web\AssetBundle;
/**
* Collapse Sidebar asset bundle
* Experimental!
*