This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="description" content="" /> | |
<meta name="keywords" content="" /> | |
<meta name="author" content="" /> | |
<meta name="HandheldFriendly" content="True" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* wysiwyg tinymce css for use in Drupal 7 | |
* with the addition of styles based on a great idea by edeverett http://edeverett.co.uk/ | |
* and diagnostic css from Eric Meyer http://meyerweb.com/eric/tools/css/diagnostics/ | |
* | |
* requires a modern browser (more recent than IE7 anyway ;-) for the base64 encoded images | |
* | |
*/ | |
p, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Implements template_preprocess_html | |
* | |
* requires: | |
* the content type to have a List[text] field called 'field_bg_colour' | |
* using Display Suite the field may be Hidden but not Disabled | |
*/ | |
function THEMENAME_preprocess_html(&$variables) { | |
// if a background colour has been set within the node, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Enable bean blocks to be themed (using a .tpl file) according to bean-type: | |
i.e. block__bean__BEAN-TYPE.tpl | |
Why? Combine a Bean Block with Display Suite and the innards of the block will match the DS layout | |
used, however the outer wrapping of the block must be themed separately. However if you write a | |
.tpl that matches the block it will take precedence and the DS layout will be lost. This prevents | |
using a DS layout for each type of Bean while simultaneously having full control over the Bean | |
Block’s mark-up. | |
This solution adds a theme hook suggestion so that .tpl files may be written for each type of Bean. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add to template.php: | |
/* | |
* Implements template_preprocess_page | |
*/ | |
function THEMENAME_preprocess_page(&$variables, $hook) { | |
// create $render_tabs & $show_render_tabs for page.tpl | |
$render_tabs = render($variables['tabs']); | |
$variables['render_tabs'] = $render_tabs; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* search an array recursively to find | |
* the first instance of a key and return its value | |
* | |
* useful when you do not know the location of a key nested (only once) in a multidimensional array | |
* | |
*/ | |
function array_find_first_recursive($needle_key, array $haystack) { | |
if (array_key_exists($needle_key, $haystack)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* returns: an array containing only the numbered keys | |
* | |
* notes: array_intersect_key() is faster than array_intersect() | |
*/ | |
function array_numbered_key_elements($array) { | |
return array_intersect_key($array, element_children($array)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* supply an array with integer and string indexes | |
* and get an associative array divided into #string & #integer | |
* or if a key_type argument is supplied then get an array with only the keys that match it | |
* | |
* arguments: | |
* $key_type is optional, and may be 'integer' or 'string' | |
* | |
* for use by process_tested_class() | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint bitwise: true, eqeq: false, sloppy: true, white: true, browser: true, devel: true, indent: 2 */ | |
/*globals phh, jQuery, window, console */ | |
/* | |
unnecessary if you only need: | |
$(window).resize(function() { | |
// do something A | |
}); | |
$(window).resize(function() { | |
// do something A | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var phh = phh || {}; | |
// jQuery closure | |
(function ($) { | |
// ready | |
$(function () { | |
if (phh.options) { | |
$.extend(true, phh.prefs, phh.options); | |
} |
OlderNewer