Skip to content

Instantly share code, notes, and snippets.

View robdecker's full-sized avatar

Rob Decker robdecker

View GitHub Profile
@robdecker
robdecker / 1.md
Last active August 25, 2020 19:57
[Field values in Twig] #d8 #twig

Fields

Body

  • Content (display): {{ content.body.0 }}
  • Content (value, formatted): {{ entity.body.value|raw }}
  • Content (value, unparsed HTML): {{ entity.body.0.value }}
  • Content (value, plain text): {{ entity.body.0.value|striptags }}
  • Summary: {{ entity.body.summary }}
@robdecker
robdecker / 1.md
Created October 31, 2019 20:54
[Form and render elements] #d8
@robdecker
robdecker / 1.md
Created October 31, 2019 20:52
[Configuration] #d8
@robdecker
robdecker / 1.md
Created October 31, 2019 20:51
[Head elements] #html
@robdecker
robdecker / 1.md
Created October 31, 2019 20:49
[Links] #d8
@robdecker
robdecker / 1.md
Last active November 10, 2020 19:27
[Twig filters, functions, tags, etc] #d8 #twig

Filters

trans / t

This filter (alternatively, t) will run the variable through the Drupal t() function, which will return a translated string. This filter should be used for any interface strings manually placed in the template that will appear for users.

@robdecker
robdecker / 1.md
Last active November 2, 2019 01:29
[Karabiner elements] #macos

Function keys tab

Target device: non internal keyboard

  • f5: to key f5
  • f6: to key f6

Complex modifications tab