This file contains hidden or 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 | |
use Drupal\views\Views; | |
// Optional, if using filter values passed via URL (see example below). | |
use Drupal\Component\Utility\Html; | |
/** | |
* Preprocesses variables for node--NODE_TYPE.html.twig. | |
* |
This file contains hidden or 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
function doGet(e) { | |
// The file that will be loaded into the template. | |
var file = 'index'; | |
// The 'secret' value, optionally passed in via URL. | |
var secret = ''; | |
// If parameter 'secret' is set, specify an alternate file to load into the | |
// template and prepare to pass the 'secret' value on. | |
if (typeof e.parameter.secret != 'undefined' && e.parameter.secret.length) { |
This file contains hidden or 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
name = Email domain users | |
description = Example module that provides a rule that will email users assigned to current domain. | |
core = 7.x | |
dependencies[] = domain | |
dependencies[] = domain_views | |
dependencies[] = entity | |
dependencies[] = node | |
dependencies[] = rules | |
dependencies[] = system | |
dependencies[] = views |
This file contains hidden or 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 | |
// Note that I'm building an HTML string for illustrative purposes only since | |
// best practice is to allow the twig templates to build HTML from the | |
// structured render arrays. | |
$html = ''; | |
$storage = \Drupal::entityManager()->getStorage('notice'); | |
$result = \Drupal::entityQuery('notice') |
This file contains hidden or 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 | |
use Drupal\editor\Entity\Editor; | |
/** | |
* Implements hook_ckeditor_css_alter(). | |
* | |
* Original source: https://drupal.stackexchange.com/a/225532 | |
*/ | |
function mytheme_ckeditor_css_alter(array &$css, Editor $editor) { |
This file contains hidden or 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-calendar: | |
css: | |
component: | |
'//addtocalendar.com/atc/1.5/atc-style-menu-wb.css': {type: external} | |
js: | |
'//addtocalendar.com/atc/1.5/atc.min.js': { type: external, minified: true } |
This file contains hidden or 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_theme_suggestions_HOOK_alter(). | |
* | |
* Original source: @jeff-burnz https://www.drupal.org/node/2724333#comment-11184655 | |
*/ | |
function mytheme_theme_suggestions_block_alter(array &$suggestions, array $vars) { | |
// Template suggestions for custom block bundles. |
This file contains hidden or 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 | |
// Drupal 7 | |
$blocks = block_list('sidebar_first'); | |
// Drupal 8 - how nice that you can specify a theme! | |
$blocks = entity_load_multiple_by_properties('block', array('theme' => $GLOBALS['theme'], 'region' => 'sidebar_first')); | |
uasort($blocks, 'Drupal\block\Entity\Block::sort'); | |
?> |
This file contains hidden or 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
describe('pages > manageVacancy', function() { | |
before( function(done) { | |
// When starting Chimp, passing the --ddp flag provides access to a global | |
// 'server' object that allows you to call methods via DDP. | |
// Since the server instance has a separate DDP connection from that between | |
// browser > server, we need to log in separately first. Requires that your app |
This file contains hidden or 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
// Set your API endpoint below! | |
'use strict'; | |
var app = angular.module('app', ['prismic.io']) | |
.config(['PrismicProvider', function(PrismicProvider) { | |
PrismicProvider.setApiEndpoint('https://[YOUR SUBDOMAIN].prismic.io/api'); | |
PrismicProvider.setLinkResolver(function(ctx, doc) { | |
return 'document/' + doc.id + '/' + doc.slug + ctx.maybeRefParam; |