Slides from my session at DrupalCamp London 2017, http://drupalcamp.london/session/building-reusable-websites-drupal-8-lessons-learned-transforming-rednosedaycom
2. • Comic Relief strives to create a just world free from
poverty
• We raise millions of pounds through two big fundraising
campaigns – Red Nose Day and Sport Relief.
• We spend that money in the best possible way to tackle
the root causes of poverty and social injustice.
• We use the power of our brand to raise awareness of the
issues that we care most about.
3. Who am I?
• Tech Lead at Comic Relief
https://technology.comicrelief.com
• Founder of Marzee Labs, a tech shop from
Barcelona @marzeelabs
• Long-time Drupal contributor @pvhee
7. A fresh start?
• Build a campaign website
• Build a product that can build campaign websites
• Build a product that allows editors to reorganise
row components to build a website
• Continuously iterate over our codebase
8. A product should…
• support iterative development
• have a clear versioning scheme
• have tests to guarantee quality
• provide a sensible default start for any campaign
• allow for customisation
9. Technology Choice?
Drupal 8, because of
• embracing industry PHP standards
• built on top of Symfony, use of Twig and Composer
• editorial features “out of the box”
• accessibility features
• built-in REST capabilities
• a development challenge
10. You can’t be that kid
standing at the top
of the waterslide,
overthinking it.
You have to go
down the chute.
Tina Fey
11. Ingredients to build our product
• Focus on Editor Experience
• Automate and streamline
• Decoupled services
13. Landing pages as the norm
• First iteration: panels with panelizer
• Second iteration: panels with panelizer and
embedded paragraphs
• Third iteration: paragraphs with block reference
14. Header with Menu
Footer
Paragraph 1
Paragraph 2
Paragraph 3
Paragraph n
… library of blocks
custom blocks
(like email signup)
Editorial blocks
Paragraph types
“content wall”
(rows + teasers are blocks)
Cards
blocks are reusable
paragraphs are not reusable
Quotes
Embed
Node Block reference
19. Living Style Guide
• Using KSS, “a documentation syntax for CSS”
• Our new “incubation area”
• Code and style guide are one — no need to update
one or the other independently thus guaranteeing
it stays fresh!
28. A build in one step
• Package up our website product using an
installation profile and using CMI, via
config_devel
• Default content in JSON
• Use a build tool — we use Phing and run
phing build often
31. No automation without tests
• Code quality checks using CodeSniffer, phpmd, phpcpd
• Configuration checks using config_devel
• Distribution installation tests using phing build
• Behavior tests on distribution using Behat
• Drupal log checks (no errors, warnings generated by Behat)
• Visual regression tests using BBC Wraith
37. Minimise custom code
• we have around 2000 custom lines of PHP code
(options callbacks, custom Display Suite fields, Solr
tweaks)
• “Non-glue code” is contributed back as standalone
Drupal modules: rabbitmq, social_links