Skip to content

Instantly share code, notes, and snippets.

public function modifyEntrySources(&$sources, $context)
{
if ($context === 'index') {
foreach ($sources as &$source) {
if (!isset($source['label'])) {
continue;
}
$total = craft()->elements->getTotalElements($source['criteria']);
$source['label'] .= ' ('. $total .')';
}
@steverowling
steverowling / goodfeedback.md
Created November 3, 2015 15:36 — forked from andrewfairlie/goodfeedback.md
Good Feedback

Getting Good Feedback

This is an open source document for web designers to modify and adapt as they see fit. The idea is that it provides a good grounding for clients to understand what makes good feedback.

The Document

@steverowling
steverowling / Contract.md
Last active February 10, 2016 17:02
The latest version of my ‘killer contract’ for web designers and developers

Contract

Forked from the popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally forked: 30th October 2015
  • Latest revision: 7th December 2015

@steverowling
steverowling / search_form_partial.html
Last active August 25, 2016 23:29
EE Search by distance from postcode using Low Search (search form)
<!-- Load Google Maps for geocoding of postcode -->
<script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
<!-- Check we have a valid UK postcode before attempting geocode lookup -->
<script>
function checkPostCode(toCheck) {
// Permitted letters depend upon their position in the postcode.
var alpha1 = "[abcdefghijklmnoprstuwyz]"; // Character 1
var alpha2 = "[abcdefghklmnopqrstuvwxy]"; // Character 2