Skip to content

Instantly share code, notes, and snippets.

View quicksketch's full-sized avatar

Nate Lampton quicksketch

View GitHub Profile

Documentation of URL Paths

This is intended to be a new sub-page in the User Guide, at User Guide > Using Backdrop > Layouts and templates > Deep dive: advanced layout options > URL paths, which would come after Visibility Conditions and Contexts sub-pages.

[Callout] URL paths allow layouts to be used on multiple menu router paths.

Layout overrides are quite powerful because a single layout can be used on multiple paths if its primary path is dynamic (i.e., contains a placeholder "%"). However, once we have defined the primary path for a layout, it won't be used on any paths whose menu router path is different. Fortunately, layouts provide a setting, "URL paths," that can allow a layout to be used on many different paths.

URL paths are a powerful feature of layouts, but they come with some new concepts and require some subtle distinctions that we have not previously delved into. So we begin this section with some useful background information.

#!/bin/bash
set -x
export PANTHEON_ENV="dev"
export PANTHEON_MACHINE_TOKEN="s7IOagnSGKr01KClaIxJwjxaaV7Tm9d0WAWp9jJZ2iatD"
# Stash org UUID
ORG_UUID="1a93e694-1903-411d-8c35-fa2d4292f9f8"
# Authenticate with Terminus

Occasionally when accessing a client network, I encounter a situation where certain servers are not accessible. Despite everyone else on the team being able to access the same domain, either by HTTP or SSH. It turns out a frequent culprit of this problem is Docker and it's networking mechanisms.

When you start up Docker, it appropriates some IP addresses for it's own usage. These are usually in the local networking space, which include the following:

  • 10.0.0.0 to 10.255.255.255
  • 172.16.0.0 to 172.31.255.255
  • 192.168.0.0 to 192.168.255.255

Discovering Conflicts

Headers:

Request method: POST
content-type: application/json
Expect: 
User-Agent: GitHub-Hookshot/c50fd76
X-GitHub-Delivery: e321a8b0-fdd7-11e8-88af-0a8f93736b51
X-GitHub-Event: release
X-Hub-Signature: sha1=a6333ac5eaabad875e21907ac0b5d607d6240c47

Backdrop Core Merging Guidelines

Set up your repo for committing

Check your Git config settings to ensure you have the right name/email for your committing process.

git config --get-regexp user

Backdrop CMS Release 1.11.0! The Backdrop community is proud to release the latest version, following our 4-month release cycle. This version of Backdrop includes lots of great new features including:

  • Editorial Image Browser: Inserting an image into the rich text editor now provides options for reusing existing images, with a fully customizeable image browser.
  • Content Preview: A completely new preview system now lets you see your changes on new and existing content before you save it. This full-page preview is shown in-place with the surrounding page and and theme, and even lets you preview different display modes (e.g. full, teaser) so you can check how your content will appear everywhere on your site.
  • Improved Color Customization for Themes: A new UI for color picking let's you adjust the colors of the included themes. The default theme "Basis" has also received color customization support, so you can colorize both Basis and Bartik themes now.
  • Hidden Paths for Content: Content can n
@quicksketch
quicksketch / buildEntityFieldQuery.php
Last active April 26, 2018 21:29
How Entity Reference module builds its SQL query
<?php
/**
* Build an EntityFieldQuery to get referencable entities.
*/
protected function buildEntityFieldQuery($match = NULL, $match_operator = 'CONTAINS') {
$query = new EntityFieldQuery();
$query->entityCondition('entity_type', $this->field['settings']['target_type']);
if (!empty($this->field['settings']['handler_settings']['target_bundles'])) {
$query->entityCondition('bundle', $this->field['settings']['handler_settings']['target_bundles'], 'IN');
}
@quicksketch
quicksketch / rename-field.php
Created March 27, 2018 20:42
Rename a Drupal 7 field machine name while maintaining field data
<?php
/**
* Rename field_resource_thumbnail to field_reference_thumbnail.
*/
function example_update_7001() {
_example_update_rename_field('field_resource_thumbnail', 'field_reference_thumbnail');
_example_update_rename_field('field_resource_short_description', 'field_reference_description');
}
@quicksketch
quicksketch / dropdown.css
Created September 6, 2016 06:36
CSS/JS needed for Dropdown menus in Admin Bar
/* All dropdown list items */
#admin-bar .dropdown li {
background-image: none;
float: left; /* LTR */
height: 100%;
list-style-image: none;
list-style-type: none;
margin: 0 !important;
padding: 0;