Skip to content

Instantly share code, notes, and snippets.

View thejimbirch's full-sized avatar

Jim Birch thejimbirch

View GitHub Profile

Drupal content moderation workflow

This is a basic comtent moderation workflow chart with basic role permissions.

This is meant to be an example of the standard moderation states and transitions.

Both moderation states and transitions can be edited in Drupal and this chart.

sequenceDiagram
@thejimbirch
thejimbirch / git_submodule_fix.md
Created January 12, 2022 17:42 — forked from claraj/git_submodule_fix.md
Fixing git submodule AKA git repo inside another git repo

Problem, and symptoms:

You experience one or more of these symptoms

  • you have code in a directory but it's not being pushed to GitHub. You just see an empty directory icon
  • you see this message when you add code to your git repository from the command prompt
hint: You've added another git repository inside your current repository.
hint: Clones of the outer repository will not contain the contents of
hint: the embedded repository and will not know how to obtain it.
This file has been truncated, but you can view the full file.
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
"environment": {
"networkUserAgent": "Mozilla/5.0 (Linux; Android 7.0; Moto G (4)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4590.2 Mobile Safari/537.36 Chrome-Lighthouse",
"hostUserAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/93.0.4577.63 Safari/537.36",
"benchmarkIndex": 1429.5,
"credits": {
"axe-core": "4.2.3"
}
},
@thejimbirch
thejimbirch / breadcrumb.html.twig
Created April 13, 2020 13:05
Add Schema.org BreadcrumbList inline in Drupal 8+ in your theme's templates.
{#
/**
* @file
* Theme override for a breadcrumb trail.
*
* Available variables:
* - breadcrumb: Breadcrumb trail items.
*/
#}
{% if breadcrumb %}
@thejimbirch
thejimbirch / metatag_example.php
Created August 19, 2019 20:27 — forked from mortenson/metatag_example.php
OR statements in metatags...
<?php
/**
* Implements hook_metatags_attachments_alter().
*
* This function allows you to define fallback tokens in case a field is empty.
*
* If all fallback values are empty, the tag will be empty.
*
* Example: [node:field_image:medium]||[node:field_legacy_image:medium]||/fallback.png
@thejimbirch
thejimbirch / contrib
Last active June 16, 2021 20:03 — forked from sean-e-dietrich/contrib
Contrib Command For Docksal
#!/bin/bash
NAME=$1
VERSION=${2:-8.8.x}
if [[ -z "${NAME}" ]]; then
NAME=$(uuidgen)
fi
if [[ -d $NAME ]]; then
@thejimbirch
thejimbirch / pull_request_template.md
Created October 10, 2018 16:12 — forked from kwhite/pull_request_template.md
An example PR template

Description

As a developer, I need to start with a story.

A few sentences describing the overall goals of the pull request's commits. What is the current behavior of the app? What is the updated/expected behavior with this PR? Include your acceptance critiera! If your tasks were well-written, you can probably copy/paste some of this.

Affected URL

link_to_relevant_multidev_or_test_site

<?php //* do not include php tag
add_filter( 'schema_wp_types', 'schema_wp_new_add_schema_type_claim_review' );
/**
* Add ClaimReview to Schema Types options
*
* @since 1.0
*/
function schema_wp_new_add_schema_type_7623456( $options ) {
@thejimbirch
thejimbirch / paragraph--xeno-hero.html.twig
Created April 23, 2017 23:46
Partial section of Xeno Hero Drupal 8 Paragraphs Template
{# Prints div with classes, & content w/o img/invert/overlay/parallax fields. #}
<div{{ attributes.addClass(classes).setAttribute('data-overlay', overlay_levels).setAttribute('data-speed', parallax_speeds) }}>
{% if content.xeno_background_image|render %}
<div class="paragraph--type--xeno-hero__image">
{{ content.xeno_background_image }}
</div>
{% endif %}
{{ content|without('xeno_background_image', 'xeno_invert', 'xeno_overlay', 'xeno_parallax') }}
</div>
@thejimbirch
thejimbirch / Gruntfile-bootstrap-3.js
Last active December 16, 2019 03:29
Bootstrap 3 and 4 Gruntfiles with copy functions to move and rename files into a Drupal or Wordpress theme. Replace SITENAME with your site or theme name.
/*!
* Bootstrap's Gruntfile
* http://getbootstrap.com
* Copyright 2013-2016 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
module.exports = function (grunt) {
'use strict';