Skip to content

Instantly share code, notes, and snippets.

@ukw-snippets
ukw-snippets / gist:5662414
Created May 28, 2013 12:29
set template based on node field
<?php
function mytheme_alpha_preprocess_node(&$variables) {
if ($variables['type'] == 'webform') {
if ($variables['field_form_type'][0]['value'] == 'contact'){
$variables['theme_hook_suggestions'][] = 'node__webform__contact';
}
else if($variables['field_form_type'][0]['value'] == 'request'){
$variables['theme_hook_suggestions'][] = 'node__webform__request';
@ukw-snippets
ukw-snippets / jquery.ba-tinypubsub.min.js
Created November 23, 2012 09:10 — forked from cowboy/HEY-YOU.md
Javascript: Tiny Pub/Sub / Observer
/* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011
* http://benalman.com/
* Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */
(function($) {
var o = $({});
$.subscribe = function() {
o.on.apply(o, arguments);
@ukw-snippets
ukw-snippets / gist:4134527
Created November 23, 2012 08:28 — forked from SirPepe/gist:1073470
CSS: Clearfix
/* Source: http://nicolasgallagher.com/micro-clearfix-hack/ */
/* For modern browsers */
.cf:before,
.cf:after {
content:"";
display:table;
}
.cf:after {