- Install Terminus:
composer global require pantheon-systems/terminus
. - Head to your Pantheon dashboard, go to your Account and click on Machine Tokens.
- Create a new token and use it auth with Pantheon:
terminus auth:login --machine-token=MACHINE-TOKEN
- Create a new site on Pantheon using terminus:
terminus site:create name-of-site "Name of Site" 35b0e365-a191-4c70-adbe-9d02d01343f3.
35b0e365-a191-4c70-adbe-9d02d01343f3
is the uuid of the Drops 8 Composer upstream. You can see a list of upstream by runningterminus upstream:list
- Once the site is created, you can head to http://dev-name-of-site.pantheonsite.io and continue with setup.
- Cloning your site on your local should give you a composer-based template.
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 | |
function _get_breadcrumb_by_nid($nid) { | |
$node = node_load($nid); | |
// If a node is not found, return. | |
if (!$node) { | |
return; | |
} |
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_responsive_panels_regions_positions_alter(). | |
*/ | |
function oa_dashboard_responsive_panels_regions_positions_alter(&$positions) { | |
// We use the top position for the breadcrumb only, so we unset it here. | |
unset($positions['top']); | |
} |
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_oa_responsive_regions_positions_alter(). | |
*/ | |
function oa_dashboard_oa_responsive_regions_positions_alter(&$positions) { | |
// We will keep the top position for the oa navbar so we unset it here. | |
unset($positions['top']); | |
} |
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 | |
/** | |
* Helper function to find users with authenticated role only. | |
*/ | |
function _users_with_authenticated_role_only() { | |
return db_query('SELECT uid, name, mail FROM users u WHERE uid > 0 AND NOT EXISTS (SELECT 1 from users_roles ur WHERE u.uid = ur.uid)')->fetchAll(); | |
} |
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_forms(). | |
*/ | |
function node_ajax_loader_forms($form_id, $args) { | |
$forms = array(); | |
if (strncmp($form_id, 'node_ajax_loader_form_', 22) === 0) { | |
$forms[$form_id] = array('callback' => 'node_ajax_loader_form'); | |
} |
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 | |
use Drupal\user\RoleInterface; | |
// Allow anonymous and authenticated users to access contact form. | |
user_role_grant_permissions(RoleInterface::ANONYMOUS_ID, array('access site-wide contact form')); | |
user_role_grant_permissions(RoleInterface::AUTHENTICATED_ID, array('access site-wide contact form')); |
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 | |
* Local development override configuration feature. | |
* | |
* To activate this feature, copy and rename it such that its path plus | |
* filename is 'sites/default/settings.local.php'. Then, go to the bottom of | |
* 'sites/default/settings.php' and uncomment the commented lines that mention | |
* 'settings.local.php'. |
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
# Local development services. | |
# | |
# To activate this feature, follow the instructions at the top of the | |
# 'example.settings.local.php' file, which sits next to this file. | |
services: | |
cache.backend.null: | |
class: Drupal\Core\Cache\NullBackendFactory | |
parameters: | |
twig.config: | |
debug: true |
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
{% for key, child in element if key|first != '#' %} | |
<div>{{ child }}</div> | |
{% endfor %} |