Skip to content

Instantly share code, notes, and snippets.

Avatar

Jen Lampton jenlampton

View GitHub Profile
View layout-template3
{
"_config_name": "layout.flexible.cbi_default",
"name": "cbi_default",
"title": "CBI Default",
"description": "",
"rows": {
"7dd0f411-6447-4e94-a700-eecbd0e663f8": {
"contains": "region_12",
"element": "header",
"classes": "",
View layout-template2
{
"_config_name": "layout.flexible.cbi_default",
"name": "cbi_default",
"title": "CBI Default",
"description": "",
"rows": {
"fcfd6d4b-35bf-4370-9709-0901f6456b6a": {
"contains": "region_8_4",
"element": "div",
"classes": "",
View layout template
{
"_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 Nov 10, 2020
How to add a subtitle to a page template
View add subtitle to 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')) {
View views.view.promoted.json
{
"_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",
View settings.local.php
<?php
/**
* @file
* Backdrop CMS configuration file.
*/
/**
* Database configuration:
*/
$database = 'mysql://backdrop:backdrop01@localhost/norecipe';
View fatal on dev
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
View views.view.file_admin.json
{
"_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",
View exported view for 3614
{
"_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": {
View caption element changes
// 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);