Skip to content

Instantly share code, notes, and snippets.

View thejimbirch's full-sized avatar

Jim Birch thejimbirch

View GitHub Profile
@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.
@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 %}
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 / 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 / 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 / paragraph--default.html.twig
Last active March 22, 2021 18:29
Drupal 8 Template for Bootstrap Paragraphs customized for Width and Background color fields.
{#
/**
* @file
* Default theme implementation to display a paragraph in Bootstrap Paragraphs.
*
* Available variables:
* - paragraph: Full paragraph entity.
* - id: The paragraph ID.
* - bundle: The type of the paragraph, for example, "image" or "text".
* - authorid: The user ID of the paragraph author.
{{ menus.menu_links(items, attributes, 0) }}
{% macro menu_links(items, attributes, menu_level) %}
{% import _self as menus %}
{% if items %}
{% if menu_level == 0 %}
<ul class="nav navbar-nav">
{% else %}
<ul class="nav navbar-nav">
{% endif %}
@thejimbirch
thejimbirch / drupal-field-bootstrap-carousel.html.twig
Last active June 24, 2020 11:55
Drupal Field Twig Template for creating a Bootstrap Carousel
@thejimbirch
thejimbirch / exposed-view-form-styling-customized.less
Last active June 9, 2020 18:53
Styling Exposed View Forms in Drupal 8
/* More customized to actual project. Added Row and Columns to elements to make them more responsive */
/* Exposed Views Form */
.views-exposed-form {
/* Adds separation between filter of results */
.make-row();
/* Floats Label to the left and aligns */
label {
.text-muted();
@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';