Skip to content

Instantly share code, notes, and snippets.

View jenlampton's full-sized avatar

Jen Lampton jenlampton

View GitHub Profile
{
"_config_name": "layout.flexible.cbi_default",
"name": "cbi_default",
"title": "CBI Default",
"description": "Default Layout Template for CBI",
"rows": {
"12e5a132-6c1f-4176-b52b-439801d77990": {
"contains": "region_8_4",
"element": "div",
"classes": "",
@jenlampton
jenlampton / add subtitle to page template
Last active November 10, 2020 18:02
How to add a subtitle to a page template
.theme file could have something like this...
function hook_preprocess_page(&$variables){
$variables['subtitle'] = FALSE;
if (arg(0) == 'node' && is_numeric(arg(1)) && !arg(2)) {
$node = node_load(arg(1)); // entity cache (in core) should save us here.
if (property_exists($node, 'field_subtitle')) {
{
"_config_name": "views.view.promoted",
"name": "promoted",
"description": "Provides a list of promoted content. Used by default on the front page.",
"module": "node",
"storage": 2,
"tag": "default",
"disabled": false,
"base_table": "node",
"human_name": "Promoted content",
<?php
/**
* @file
* Backdrop CMS configuration file.
*/
/**
* Database configuration:
*/
$database = 'mysql://backdrop:backdrop01@localhost/norecipe';
Fatal error: Uncaught Error: Class 'Drupal\block_content\Access\BlockContentAddAccessCheck' not found in /mnt/www/html/mtccms04dev/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php:269
Stack trace:
#0 /mnt/www/html/mtccms04dev/docroot/core/lib/Drupal/Component/DependencyInjection/Container.php(173): Drupal\Component\DependencyInjection\Container->createService(Array, 'access_check.bl...')
#1 /mnt/www/html/mtccms04dev/docroot/core/lib/Drupal/Core/Access/CheckProvider.php(100): Drupal\Component\DependencyInjection\Container->get('access_check.bl...')
#2 /mnt/www/html/mtccms04dev/docroot/core/lib/Drupal/Core/Access/CheckProvider.php(159): Drupal\Core\Access\CheckProvider->loadCheck('access_check.bl...')
#3 /mnt/www/html/mtccms04dev/docroot/core/lib/Drupal/Core/Access/CheckProvider.php(83): Drupal\Core\Access\CheckProvider->loadDynamicRequirementMap()
#4 /mnt/www/html/mtccms04dev/docroot/core/lib/Drupal/Core/Routing/RouteBuilder.php(191): Drupal\Core\Access\CheckProvider->setChecks(Object(Symfon
{
"_config_name": "views.view.file_admin",
"name": "file_admin",
"description": "Administrative listing for managing files.",
"module": "file",
"storage": 2,
"tag": "default",
"disabled": false,
"base_table": "file_managed",
"human_name": "Administer files",
{
"_config_name": "views.view.test_reduced_exposed_grouped_options",
"name": "test_reduced_exposed_grouped_options",
"description": "",
"tag": "default",
"disabled": false,
"base_table": "node",
"human_name": "test_reduced_exposed_grouped_options",
"core": "1.14.x-dev",
"display": {
// Center aligned content requires an additional wrapper to set
// text-align: center.
if ($align === 'center') {
// If the image has a caption
$caption = $node->getAttribute('data-caption');
if ($caption) {
// something like this, but in PHP
// element.replaceWith(figure);
// figure.add(element);
$form['warning'] = array(
'#type' => 'help',
'#display' => 'warning',
'#markup' => t('this is a warning!'),
);
@jenlampton
jenlampton / user.role.board
Last active November 8, 2017 22:55
user.role.board.json file, with a string of <NULL>s added at the end
{
"_config_name": "user.role.board",
"name": "board",
"label": "Board",
"weight": "3",
"permissions": [
"edit own board_member content",
"create sponsor content",
"edit own sponsor content",
"edit any sponsor content",