$ drush vset install_profile standard
$ drush rr
$ drush cc all
$ drush sqlq "DELETE FROM `system` WHERE filename LIKE 'profiles/pantheon/pantheon.profile'"
$ drush sqlq "UPDATE `system` SET status=1 WHERE filename LIKE 'profiles/standard/standard.profile'"
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> | |
<head> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/css/normalize.min.css" rel="stylesheet" type="text/css" /> | |
<link href="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/css/foundation.min.css" rel="stylesheet" type="text/css" /> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/js/vendor/modernizr.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/js/vendor/jquery.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/foundation/5.5.2/js/foundation.min.js"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> |
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
<p>The more I work with Drupal 8, the more I realize how much has changed for developers in the Drupal community. While the transition to a modern, object-oriented system is what's best for the longevity of the platform, it certainly doesn't come without challenges. As someone who doesn't come from an OOP background, I've found the transition difficult at times. In many cases, I know exactly <em>what</em> I want to do, just not <em>how</em> to do it the "Drupal 8 way". On top of this, tutorials and blog posts on D8 are all over the map in terms of accuracy. Many posts written during D8's development cycle are no longer applicable because of API changes, etc.</p> | |
<p>Below is a list of snippets that might be helpful to site builders or developers more familiar with D7 hooks and procedural. It might also be useful to OOP folks who are new to Drupal in general. My goal below is to add to and update these snippets over time.</p> | |
<h2>Routes & Links</h2> | |
<h3>Determine the Current Drupal Route</h3> | |
<p>Need to |
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_menu(). | |
*/ | |
function THEME_preprocess_menu(&$vars, $hook) { | |
if ($hook == 'menu__account') { | |
$items = $vars['items']; | |
foreach ($items as $key => $item) { | |
if ($key == 'user.page') { |
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_menu(). | |
*/ | |
function THEME_preprocess_menu(&$vars, $hook) { | |
if ($hook == 'menu__main') { | |
$items = $vars['items']; | |
foreach ($items as $key => $item) { | |
$original_title = $vars['items'][$key]['title']; |
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_form_FORM_ID_alter(). | |
*/ | |
function abc_form_taxonomy_form_term_alter(&$form, &$form_state) { | |
// Move all fieldsets into vertical-tabs. | |
$form['additional_settings'] = array( | |
'#type' => 'vertical_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
<?php | |
/** | |
* Unset an item from an array by its value. | |
*/ | |
function unset_byvalue(array $array = array(), $value = '') { | |
$index = array_search($value, $array, TRUE); | |
if ($index !== FALSE) { | |
unset($array[$index]); | |
} |
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 | |
class MeetingsController extends \BaseController { | |
/** | |
* Display a listing of the resource. | |
* GET /meetings | |
* | |
* @return Response | |
*/ |
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
// Generated on 2013-06-04 using generator-webapp 0.1.7 | |
'use strict'; | |
var lrSnippet = require('grunt-contrib-livereload/lib/utils').livereloadSnippet; | |
var mountFolder = function (connect, dir) { | |
return connect.static(require('path').resolve(dir)); | |
}; | |
// # Globbing | |
// for performance reasons we're only matching one level down: | |
// 'test/spec/{,*/}*.js' |
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 | |
$guid = getGUID(array('{','}')); | |
print $guid; | |
function getGUID($strip = array()) { | |
$guid = ''; | |
if (function_exists('com_create_guid')) { | |
$guid = com_create_guid(); |