Skip to content

Instantly share code, notes, and snippets.

@alisonjo315
alisonjo315 / optgroup_demo.md
Last active November 7, 2023 23:56
optgroup demo

optgroup demo

Adding optgroup elements to a "has taxonomy term (with depth)" exposed filter on a Drupal 9/10 view (for sharing on Drupal issue #2384203).

Screenshot of what the select with optgroup looks like on our site, edited for length: image

Select with optgroup HTML:

<select data-drupal-selector="edit-unique-category-depth-filter" id="edit-unique-category-depth-filter" name="unique_category_depth_filter" class="form-select">
  <option value="All" selected="selected">- Any -</option>
@alisonjo315
alisonjo315 / ckeditor_templates.js
Last active November 16, 2022 00:32
Excerpt from a ckeditor_templates.js file
CKEDITOR.addTemplates( 'default', {
// The templates definitions.
templates: [{
title: "Two Column Section",
html: '<div class="two-col padded"><div><p>Column One</p></div><div><p>Column Two</p></div></div><p></p>'
}, {
title: "Blockquote with Citation Footer",
html: '<blockquote><p>The <code>blockquote</code> element represents content that is quoted from another source, optionally with a citation which must be within a <code>footer</code> or <code>cite</code> element, and optionally with in-line changes such as annotations and abbreviations.</p><p>Content inside a <code>blockquote</code> other than citations and in-line changes must be quoted from another source, whose address, if it has one, may be cited in the cite attribute.</p><footer><cite><a href="http://www.w3.org/html/wg/drafts/html/master/semantics.html#the-blockquote-element">4.4.4 The blockquote element</a> - W3C Working Group, 2013</cite></footer></blockquote>'
}, {
title: "Panel Div",
@alisonjo315
alisonjo315 / pantheon-custom-upstream-setup.terminal-output-history.20170503.sh
Created May 17, 2017 18:52
Pantheon custom upstream setup: Terminal output history
✘ 16:58:46 alison@alison: ~/workspace/cdd8[bu-su]$ terminus auth:whoami
alison@cornell.edu
✔ 17:40:51 alison@alison: ~/workspace/cdd8[bu-su]$ git checkout startup
Switched to branch 'startup'
Your branch is up-to-date with 'origin/startup'.
✔ 17:41:15 alison@alison: ~/workspace/cdd8[startup]$ terminus build-env:create-project prup-cdd8
Please generate a GitHub personal access token by visiting the page:
https://github.com/settings/tokens