Skip to content

Instantly share code, notes, and snippets.

View micahw156's full-sized avatar

Micah Webner micahw156

View GitHub Profile
@sdboyer
sdboyer / .gitconfig
Created April 13, 2011 16:08 — forked from rfay/.gitconfig
# Put this in your .gitconfig
[url "ssh://git@git.drupal.org/sandbox/"]
insteadOf = "dos:"
[url "ssh://git@git.drupal.org/project/"]
insteadOf = "do:"
@jacine
jacine / field.tpl.php
Created August 31, 2011 18:33
My default hook_preprocess_field() and field.tpl.php
<?php
/**
* Implements template_preprocess_field().
*/
function THEME_preprocess_field(&$vars) {
// If the view mode is "full" use <h2> for the field labels. Otherwise,
// assume a teaser or more compact view mode is being displayed, and use <h3>.
$vars['heading'] = ($vars['element']['#view_mode'] == 'full') ? 'h2' : 'h3';
@jacine
jacine / .htaccess
Created December 1, 2011 23:10
My favorite Drupal trick for local theme development
# Find this line and insert the code below it (adapted to use your sitename/server).
# RewriteBase /
# Use files on the dev server instead of syncing them locally.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^sites/sitename/(files/.*)$ http://dev.whatever.com/sites/sitename/$1 [L,QSA]
@davereid
davereid / custom.admin_menu.inc
Last active September 29, 2015 07:18
Useful D7 custom functions
<?php
/**
* @file
* Administration menu integration for the custom module.
*/
/**
* Implements hook_admin_menu_cache_info().
*/
@jensimmons
jensimmons / views-view-grid.tpl.php
Created April 3, 2012 21:00
Switching Drupal Views Grid to unordered lists
<?php
/**
* @file views-view-grid.tpl.php
* Default simple view template to display a rows in a grid.
*
* - $rows contains a nested array of rows. Each row contains an array of
* columns.
*
* @ingroup views_templates
*/