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
/** | |
* Remove the instance of the body field from my_content_type | |
*/ | |
function my_feature_update_7000() { | |
$instance = field_info_instance('node', 'body', 'my_content_type'); | |
field_delete_instance($instance); | |
} |
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
<?php | |
// path/to/mytheme/plugins/layouts/pull_hero_region_layout/pull_hero_region_layout.tpl.php | |
/** | |
* @file | |
* Template for the "pull_hero_region_layout" layout. | |
* | |
* | |
* Variables: | |
* - $has_content: Boolean TRUE if any regions have content to display. | |
* - $attributes: A list of attributes for the layout container. |
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
// Animated throbber | |
html.js .form-autocomplete { | |
background-image: image-url('svg/throbber-inactive.svg'); | |
background-position: 95% center; | |
background-position: -webkit-calc(100% - 5px) center; | |
background-position: calc(100% - 5px) center; | |
background-repeat: no-repeat; | |
} | |
html.js .throbbing { |
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
<?php | |
/** | |
* Implements hook_css_alter(). | |
*/ | |
function mytheme_css_alter(&$css) { | |
global $language; | |
// If the current language is RTL, find and remove CSS files from this | |
// theme that have the RTL overrides. Drupal's RTL methodology adds files |
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
<?php | |
/** | |
* Implements hook_preprocess_block(). | |
*/ | |
function mymodule_preprocess_entity(&$variables) { | |
// modify the classes on bean entities. | |
if ($variables['entity_type'] == 'bean') { | |
$variables['classes_array'] = array( | |
drupal_html_class($variables['bean']->type), |
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
<?php | |
/** | |
* @file | |
* html_in_title.features.filter.inc | |
*/ | |
/** | |
* Implements hook_filter_default_formats(). | |
*/ | |
function html_in_title_filter_default_formats() { |
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
/** | |
* Technique from http://lea.verou.me/2011/01/styling-children-based-on-their-number-with-css3/ | |
*/ | |
/* one item */ | |
li:first-child:nth-last-child(1) { | |
width: 100%; | |
} | |
/* two items */ |
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
<?php | |
// Place script in root directory of Drupal installation. | |
// From https://www.drupal.org/node/1080330#comment-6520842 | |
define('DRUPAL_ROOT', getcwd()); | |
require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; | |
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); | |
function nobueno() { | |
$startingtime = microtime(true); | |
$o = '<p>Checking for dead modules ...</p>'; | |
$result = db_select('system') |
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
// Place this in mymodule.module | |
/** | |
* Implements hook_panels_pre_render(). | |
*/ | |
function mymodule_panels_pre_render($panels_display, $renderer) { | |
// Add a body class for all panel layouts present on a given page. This | |
// functionality piggy-backs on Panels 'body_classes_to_add' functionality. | |
// And let's us do clever things like null out the max-width of container |