~/talk

Twig recipes: Making Drupal 8 render the markup you want

Talkat DrupalCamp Twin Cities 2017 · 2017-06-22..06-25· [drupal, css]
slides:none on file

Explains concrete Twig recipes for Drupal 8: how to pass backend values via theme preprocess PHP hooks into templates, use set variables with set and render arrays to conditionally show fields (trim whitespace from boolean renders), convert image fields to CSS backgrounds using URL formatter (8.3) or the contrib URL module for 8.2, inline SVG/file URLs as HTML src, build absolute node links with url(route, {node: nid}) found via Drupal Console, and how to enable twig debug to see template suggestions.

AI-written summary · about

  1. 0:00Introduction to Drupal themes
  2. 2:33Template hierarchy explained
  3. 7:12Introduction to Twig
  4. 10:14Twig syntax and variables
  5. 14:01Filters, functions, and tests
  6. 21:16Control structures in Twig
  7. 25:10Overriding markup with debug
  8. 36:51Practical recipes for templating
~/search
type to search 6,518 conferences, 143,918 speakers and 192,133 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.