SlideShare a Scribd company logo
1 of 54
Download to read offline
Streamlined Drupal 8
Site Building Strategies for Tight Deadlines
Pantheon.io 2
Who Are We?
Steve Persch
Lead Developer Advocate
at Pantheon
Jody Hamilton
Co-Founder and CTO
at Zivtech
3
Less is More
Lean on Core
What We’ll Cover
● Building the IA components
● Admin Experience
● Building Content Editing
Experience
● Displaying your Content
● View Modes and Field
Formatters
● Twig
● Views
● Developer Workflow
4
IA the Easy Way
Menus
Use blocks to position your
menus sitewide
● Core menu blocks have
depth and visibility level
settings
● Contrib ‘Menu Block’
module has more options
6
Pantheon.io 7
Path Patterns for the URL-oriented
● Pathauto is still in Contrib
● Set paths to match menu structure:
○ Page Content Type: [node:menu-link:parent:url:path]/[node:title]
○ Place other content types below their main listing page, e.g. if your
Team listing page is /about/team, set Team Member Content Type
pattern to about/team/[node:title]
Breadcrumbs
No More Tears
D8 Breadcrumbs follow Path
Structure (not Menu Tree)
Easy Breadcrumb Contrib module provides
additional display options
8
Admin & Editor Experience
Pantheon.io
Admin Toolbar Contrib Module
- Extend the core Toolbar with
dropdown menus
- Enable its submodules
10
Pantheon.io 11
Managing User Roles & Permissions
● You still need Role Delegation
or RoleAssign Contrib module
to allow editors to create
editor accounts
● Advocate for fewer roles to
start
● Test editor experience using
editor role
Building your Content Editing
Experience
Pantheon.io 13
CKEditor in Drupal
- No WYSIWYG Configuration
Required!
- Images with Captions!
- Enhance with:
- Linkit
- CKEditor Media Embed
- Custom Styles
Pantheon.io 14
Field Types
- Boolean
- Date (and date range)
- Email
- Phone
- Link
- Numbers (integer, decimal, float, list)
- Text (long/short, formatted/plain, list)
- Entity References (content, term, user,
file, image, etc.)
Pantheon.io
Manage Form Displays
- Disable fields from displaying on
forms
- Add more form (and view) display
modes at Admin: Structure: Display
Modes
- Field Group Contrib Module is stable
15
Pantheon.io 16
Field Widgets
Common Widget Choices:
- Lists: checkboxes/radios
or select?
- References: select,
checkboxes/radios, or
autocomplete?
Pantheon.io 17
Paragraphs: Flexible Landing Pages
- Avoid Panels ecosystem for
your D8 site for now
- Paragraphs works well with
component-based design
- Paragraphs ecosystem is
growing:
- Bootstrap Paragraphs
- Parade
Pantheon.io 18
Media: We’re Getting There
- Media in 8.5 is half-baked
- Media is included via
entityreference
- Enhance with:
- Inline Entity Form
- Entity Browser
- Stick with generic Image
and File fields if you can
for now
Displaying Your Content
Strategies for
Customizing Display
1. Very specific CSS for default
Drupal markup
2. Template overrides for
exacting markup
3. Custom plugins for site
building and exact markup
20
21
Override
or Extend?
For more on this
evolution, see what I
said in 2015
Rendering HTML with Drupal,
Past, Present, and Future at
Twin Cities Drupal Camp
22
Pantheon.io 23
Theme Regions
Pantheon.io 24
The "Content" Block is Still Special
25
26
View Modes and Field Formatters
Pantheon.io 28
View Modes
Pantheon.io 29
View Modes and Field Formatters
30
Pantheon.io 31
Custom Field Formatter
Pantheon.io 32
View Modes and Field Formatters
33
Pantheon.io 34
Template Overrides (seen via Twig debug)
<!-- THEME DEBUG -->
<!-- THEME HOOK: 'node' -->
<!-- FILE NAME SUGGESTIONS:
* node--view--articles-aside--block-2.html.twig
* node--view--articles-aside.html.twig
* node--3--highlighted-small.html.twig
* node--3.html.twig
* node--article--highlighted-small.html.twig
* node--article.html.twig
x node--highlighted-small.html.twig
* node.html.twig
-->
<!-- BEGIN OUTPUT from
'core/profiles/demo_umami/themes/umami/templates/content/node--highlighte
d-small.html.twig' -->
Pantheon.io 35
Layouts
Pantheon.io 36
Generating Code with Drupal Console
drupal generate:plugin:fieldformatter
drupal generate:plugin:fieldwidget
drupal generate:plugin:module
drupal generate:plugin:theme
drupal generate:plugin:command
Twig
<div>
{{ twig }}
</div>
38
Pantheon.io 39
Twig Security
PHPTemplate:
<div class="content">
<?php print $content; ?>
</div>
Twig:
<div class="content">
{{ content }}
</div>
Pantheon.io 40
Twig Security, Escape by Default
PHPTemplate:
<?php
print check_plain($title);
?>
Twig:
{{ title }}
Pantheon.io 41
Twig Security, Ask For Raw Values
PHPTemplate:
<?php print $title; ?>
Twig:
{{ title|raw }}
Pantheon.io 42
Conditionals
PHPTemplate:
<?php if ($count > 0): endif; ?>
Twig:
{% if count > 0 %} {% endif %}
Pantheon.io 43
Control Structures
PHPTemplate:
<?php
foreach ($users as $user) {
}
?>
Twig:
{% for user in users %}
{% endfor %}
Pantheon.io 44
File Names
PHPTemplate:
node--article.tpl.php
Twig:
node--article.html.twig
Pantheon.io 45
Twig Tweak Module
{{ drupal_view('who_s_new', 'block_1') }}
{{ drupal_block('system_powered_by_block') }}
{{ drupal_region('sidebar_first') }}
{{ drupal_entity('node', null, 'teaser') }}
{{ drupal_field('field_image', 'node', 1) }}
Pantheon.io 46
Twig Include, Extend, and Embed
https://twig.symfony.com/doc/2.x/tags/embed.html
Views
Pantheon.io 48
Lists of Entities, Rendered using View Modes
Pantheon.io 49
Keep your Views simple
Pantheon.io 50
Direct rendering of fields in tables
Dev Workflow
Pantheon.io 52
Config Management Workflow
Pantheon.io 53
Composer - Dependency Management for PHP
symfony/class-loader
symfony/http-kernel
symfony/serializer
twig/twig
drupal/core asm89/stack-cors
drupal/drupal
my/project
drupal/address commerceguys/addressing
Questions?

More Related Content

Similar to Streamlined Drupal 8: Site Building Strategies for Tight Deadlines

Zimmertwins Presentation
Zimmertwins PresentationZimmertwins Presentation
Zimmertwins Presentation
Ashok Modi
 
Building a Simple, Responsive Website with ExpressionEngine
Building a Simple, Responsive Website with ExpressionEngineBuilding a Simple, Responsive Website with ExpressionEngine
Building a Simple, Responsive Website with ExpressionEngine
Ottergoose
 

Similar to Streamlined Drupal 8: Site Building Strategies for Tight Deadlines (20)

Build Python CMS The Plone Way
Build Python CMS The Plone WayBuild Python CMS The Plone Way
Build Python CMS The Plone Way
 
SharePoint Branding From Start to Finish
SharePoint Branding From Start to FinishSharePoint Branding From Start to Finish
SharePoint Branding From Start to Finish
 
Drupal_cubet seminar
Drupal_cubet seminarDrupal_cubet seminar
Drupal_cubet seminar
 
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
 
Willow, the interaction tour by Maxi Tabacman
Willow, the interaction tour by Maxi TabacmanWillow, the interaction tour by Maxi Tabacman
Willow, the interaction tour by Maxi Tabacman
 
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
Modern Theming & The Future of WordPress- Working with Full Site Editing and ...
 
Modernising AEM Sites Codebase (AEM Meetup 2019)
Modernising AEM Sites Codebase  (AEM Meetup 2019)Modernising AEM Sites Codebase  (AEM Meetup 2019)
Modernising AEM Sites Codebase (AEM Meetup 2019)
 
Expanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate UsabilityExpanding XPages with Bootstrap Plugins for Ultimate Usability
Expanding XPages with Bootstrap Plugins for Ultimate Usability
 
Share point 2013 Building Websites
Share point 2013 Building WebsitesShare point 2013 Building Websites
Share point 2013 Building Websites
 
SharePoint 2010 For Developers
SharePoint 2010 For DevelopersSharePoint 2010 For Developers
SharePoint 2010 For Developers
 
Zimmertwins Presentation
Zimmertwins PresentationZimmertwins Presentation
Zimmertwins Presentation
 
Magento
MagentoMagento
Magento
 
Building a Simple, Responsive Website with ExpressionEngine
Building a Simple, Responsive Website with ExpressionEngineBuilding a Simple, Responsive Website with ExpressionEngine
Building a Simple, Responsive Website with ExpressionEngine
 
Building and Deployment of Drupal sites with Features and Context
Building and Deployment of Drupal sites with Features and ContextBuilding and Deployment of Drupal sites with Features and Context
Building and Deployment of Drupal sites with Features and Context
 
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
A Sneak Peek At Visual Studio 2010 And .Net Framework 4.0
 
Designing SharePoint 2010 for Business
Designing SharePoint 2010 for BusinessDesigning SharePoint 2010 for Business
Designing SharePoint 2010 for Business
 
An Introduction to Django Web Framework
An Introduction to Django Web FrameworkAn Introduction to Django Web Framework
An Introduction to Django Web Framework
 
Html5
Html5Html5
Html5
 
Uniface 10 IDE Under the Hood
Uniface 10 IDE Under the HoodUniface 10 IDE Under the Hood
Uniface 10 IDE Under the Hood
 
Choosing A Web Cms And Intro To Modx
Choosing A Web Cms And Intro To ModxChoosing A Web Cms And Intro To Modx
Choosing A Web Cms And Intro To Modx
 

More from Pantheon

Testing Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowTesting Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade Workflow
Pantheon
 

More from Pantheon (20)

Drupal Migrations in 2018
Drupal Migrations in 2018Drupal Migrations in 2018
Drupal Migrations in 2018
 
Architecting Million Dollar Projects
Architecting Million Dollar ProjectsArchitecting Million Dollar Projects
Architecting Million Dollar Projects
 
Getting Started with Drupal
Getting Started with DrupalGetting Started with Drupal
Getting Started with Drupal
 
Defense in Depth: Lessons Learned Securing 200,000 Sites
Defense in Depth: Lessons Learned Securing 200,000 SitesDefense in Depth: Lessons Learned Securing 200,000 Sites
Defense in Depth: Lessons Learned Securing 200,000 Sites
 
Automate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon ViennaAutomate Your Automation | DrupalCon Vienna
Automate Your Automation | DrupalCon Vienna
 
Sub-Second Pageloads: Beat the Speed of Light with Pantheon & Fastly
Sub-Second Pageloads: Beat the Speed of Light with Pantheon & FastlySub-Second Pageloads: Beat the Speed of Light with Pantheon & Fastly
Sub-Second Pageloads: Beat the Speed of Light with Pantheon & Fastly
 
Building a Network of 195 Drupal 8 Sites
Building a Network of 195 Drupal 8 Sites Building a Network of 195 Drupal 8 Sites
Building a Network of 195 Drupal 8 Sites
 
Hacking Your Agency Workflow: Treating Your Process Like A Product
Hacking Your Agency Workflow: Treating Your Process Like A ProductHacking Your Agency Workflow: Treating Your Process Like A Product
Hacking Your Agency Workflow: Treating Your Process Like A Product
 
Best Practice Site Architecture in Drupal 8
Best Practice Site Architecture in Drupal 8Best Practice Site Architecture in Drupal 8
Best Practice Site Architecture in Drupal 8
 
Development Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP LibrariesDevelopment Workflow Tools for Open-Source PHP Libraries
Development Workflow Tools for Open-Source PHP Libraries
 
WordPress REST API: Expert Advice & Practical Use Cases
WordPress REST API: Expert Advice & Practical Use CasesWordPress REST API: Expert Advice & Practical Use Cases
WordPress REST API: Expert Advice & Practical Use Cases
 
Continuous Integration Is for Teams: Moving past buzzword driven development
Continuous Integration Is for Teams: Moving past buzzword driven development Continuous Integration Is for Teams: Moving past buzzword driven development
Continuous Integration Is for Teams: Moving past buzzword driven development
 
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
Creating a Smooth Development Workflow for High-Quality Modular Open-Source P...
 
Testing Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade WorkflowTesting Your Code as Part of an Industrial Grade Workflow
Testing Your Code as Part of an Industrial Grade Workflow
 
Test Coverage for Your WP REST API Project
Test Coverage for Your WP REST API ProjectTest Coverage for Your WP REST API Project
Test Coverage for Your WP REST API Project
 
Drupal 8 and Pantheon
Drupal 8 and PantheonDrupal 8 and Pantheon
Drupal 8 and Pantheon
 
Why Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your ClientsWhy Your Site is Slow: Performance Answers for Your Clients
Why Your Site is Slow: Performance Answers for Your Clients
 
Drupal Performance
Drupal Performance Drupal Performance
Drupal Performance
 
WP or Drupal (or both): A Framework for Client CMS Decisions
WP or Drupal (or both): A Framework for Client CMS Decisions WP or Drupal (or both): A Framework for Client CMS Decisions
WP or Drupal (or both): A Framework for Client CMS Decisions
 
Level Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress PerformanceLevel Up: 5 Expert Tips for Optimizing WordPress Performance
Level Up: 5 Expert Tips for Optimizing WordPress Performance
 

Recently uploaded

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Recently uploaded (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Streamlined Drupal 8: Site Building Strategies for Tight Deadlines