SlideShare a Scribd company logo
1 of 22
Download to read offline
Efficiently theming a multi-site
Drupal 8 portal
How a single Drupal theme can be used for a
complex multi-site Drupal installation
Hello everyone, we are...
Nesta (@Nesta_)
Technical Architect
and QA
8+ years working
with Drupal
Enno (@langelotz)
Frontend Developer,
SEO specialist
7+ years working
with Drupal
La Drupalera (@ladrupalera)
One of the premier Drupal
agencies in Spain with
headquarters in Seville.
Drupal 8
Multisite 3
Considering using a single theme for a Drupal 8
multisite environment
Critical points:
● similar branding and
styles?
● common navigation
elements?
● overlapping content?
Drupal 8
Multisite 2
Drupal 8
Multisite 1
Shared
code
Theme 1
Theme 2
Theme 3
Drupal 8
Multisite 3
Similarities for the individual sites can justify the use
of a single theme
Critical points:
● similar branding and
styles
● common navigation
elements
● overlapping content
Drupal 8
Multisite 2
Drupal 8
Multisite 1
Shared
code
Theme 1
Real life example: Sevilla FC
Highly visible futbol portal
> 500k visits/month
3 portals in a multisite
installation
13 different languages
Functional requirements for our single theme
Customer 1:
“We want everything to look the same, but portal 1 has an additional sidebar.”
Customer 2:
“We have a general company branding, but each department with its own
subsite has its own logo and colors.”
Customer 3:
“One of our portals has special content, which has its own design different from
our general style guide.”
Technical requirements
● Create custom CSS/JS for each portal of the multisite installation
● Don’t create unnecessary or duplicate CSS
● Have a technical solution for whatever design exception is thrown at us during
the development cycle
● Be able to modify styles for any region/page/node/block in any site at
any point in time without being worried about side effects
Rules, that help the team work together and create a
better product
● Empower your frontend developers to allow them making informed decisions
● Separate general components (your style guide) from block/page specific
design
● Have a specific task for the theme setup that solves basic theme foundations
such as grid, typography, variables, theme structure and common elements
● Talk to each other, so you can help each other out with reusable code
The Theme basis we work with
● Gulp/Grunt for CSS/JS creation
● No predefined framework like Bootstrap - we use individual external libraries
as needed. Examples:
○ Susy
○ Breakpoint
● Sass as our preprocessor of choice
● Sass archive hierarchy loosely based on SMACSS, but Drupal specific
Sass to the rescue
Sass allows us to import or write our
Code in small chunks and different
archives and then put it all together
for the final compilation into css.
For a single site installation,
everything is brought together in one
central file: main.sass
@import external libraries
@import utilities
@import base styles
@import layout
Using a strict Sass archive hierarchy
The theme defines the basic approach:
● Hierarchical structure of folders
● Archives for basic components
● Order of compilation
● Imported code
The frontend developer decides:
● Level of implementation: Page, view,
block, node, etc.
● Use of mixins and extends
Sass
External
Utilities
Base
Components
Layout
Blocks
Views
Pages
Nodes
Code example 1
Drupal 8 Sass Folder structure in Editor
Questions for the frontend developer
Main Content Sidebar
Header
Static
Block
View
Node
Footer
Decision Tree Example
Project Manager: “Apply the necessary styles to the sidebar!”
What is my content in the sidebar?
Custom block and view. -> Divide the tasks
Is my custom block used anywhere else on the portal?
No -> Create Sass file for the block, insert the styles.
Is my view using nodes or fields?
Node teasers.
Are the node teasers used anywhere on the side in a
different context?
No -> Create node teaser twig template and Sass archive.
Node
Workflow in abstract form
1. Receive the task
2. Analyze the situation
3. Define and create necessary Sass files to work on
4. Create/adapt mixins/extends/functions/variables
5. Create the specific styles
Creating and using the individual Sass archive
Example: Drupal Search block
Folder for the block Sass file: layout/blocks
.search-block-form = _block-search-block-form.sass
Important rule for determining the right context:
No styles allowed that cannot be inserted by using “.search-block-form” as the
first css class.
.page-node-15 .search-block-form <- We don’t want that!
Code example 2
Example Sevilla FC - Block Pasion Sevillista
Identifying and changing a Sass file
Taking care of the multisite optional styles
We will need optional styles for each subsite. Our main.sass file stops being the
all-including style file.
main.sass - Contains all basic styles
layout-default.sass - Contains the default layout styles
site1.sass - Contains only site-specific styles
The layout folder is duplicated for each subsite.
Where to put the code on multisite?
Decision Tree Example
Project Manager: “Apply the necessary styles to the sidebar!”
What is my content in the sidebar?
Custom block and view. -> Divide the tasks
Are the styles specific to one/several subsites or generally applicable ?
Specific to one side -> Use the Sass folder for the specific site
Is my custom block used anywhere else on the portal?
No -> Create Sass file for the block, insert the styles.
Further theme preprocess changes for multisite
Additional css classes for the <body> element can help adding specific styles
more easily.
<body> CSS class for:
● Subsite
● Language
● Node ID
Code example 3
a) Multisite folder structure example.
b) Adapted theme.libraries file to create the necessary multisite css.
c) Preprocess changes in the theme to add body classes
Room for optimization - get feedback from frontend
Don’t wait with the Sass/CSS until after Sitebuilding is finished!
Your frontend developer can help to shorten the process by pointing out simple
HTML changes that can be achieved by:
● Changing views to use global fields
● Creating custom node displays
● Adding css IDs/classes
● Changing the order of blocks/panels/paragraphs
● Adding or removing containers that are set with DS, Panels or similar
Thank you very much for your attention. Questions?

More Related Content

What's hot

Drupal 8 Configuration Management
Drupal 8 Configuration ManagementDrupal 8 Configuration Management
Drupal 8 Configuration ManagementExove
 
Drupal 7 for Government Case Study: Presentation at DrupalCamp Montreal 2012
Drupal 7 for Government Case Study: Presentation at DrupalCamp Montreal 2012Drupal 7 for Government Case Study: Presentation at DrupalCamp Montreal 2012
Drupal 7 for Government Case Study: Presentation at DrupalCamp Montreal 2012Suzanne Dergacheva
 
Amplexor Drupal for the Enterprise seminar - evaluating Drupal for the Enterp...
Amplexor Drupal for the Enterprise seminar - evaluating Drupal for the Enterp...Amplexor Drupal for the Enterprise seminar - evaluating Drupal for the Enterp...
Amplexor Drupal for the Enterprise seminar - evaluating Drupal for the Enterp...Amplexor
 
Drupal 7 vs. Drupal 8: A Contrast of Multilingual Support
Drupal 7 vs. Drupal 8: A Contrast of Multilingual SupportDrupal 7 vs. Drupal 8: A Contrast of Multilingual Support
Drupal 7 vs. Drupal 8: A Contrast of Multilingual SupportAcquia
 
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-NapocaCMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-NapocaNuvole
 
Drupal 8 Vocabulary Lesson
Drupal 8 Vocabulary LessonDrupal 8 Vocabulary Lesson
Drupal 8 Vocabulary LessonMediacurrent
 
What is Drupal? An Introduction to Drupal 8
What is Drupal? An Introduction to Drupal 8What is Drupal? An Introduction to Drupal 8
What is Drupal? An Introduction to Drupal 8Suzanne Dergacheva
 
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...Srijan Technologies
 
Don’t fight with windmills. Upgrade path tool from OpenY distro - Igor Karpil...
Don’t fight with windmills. Upgrade path tool from OpenY distro - Igor Karpil...Don’t fight with windmills. Upgrade path tool from OpenY distro - Igor Karpil...
Don’t fight with windmills. Upgrade path tool from OpenY distro - Igor Karpil...DrupalCamp Kyiv
 
10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-BoxSuzanne Dergacheva
 
Drupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of TartuDrupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of TartuRené Lasseron
 
Code driven development in drupal
Code driven development in drupalCode driven development in drupal
Code driven development in drupalAndriy Yun
 
MongoDB Jump Start
MongoDB Jump StartMongoDB Jump Start
MongoDB Jump StartHaim Michael
 
Drupal contributor HOWTO
Drupal contributor HOWTODrupal contributor HOWTO
Drupal contributor HOWTOAndriy Yun
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?nuppla
 
World is changed. i feel it in the front end
World is changed. i feel it in the front endWorld is changed. i feel it in the front end
World is changed. i feel it in the front endAndriy Yun
 
Presentation on octobercms
Presentation on octobercmsPresentation on octobercms
Presentation on octobercmsRamesh Adhikari
 
Drupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionDrupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionJeff Geerling
 
Digital Signage for YMCA and the Drupal role
Digital Signage for YMCA and the Drupal roleDigital Signage for YMCA and the Drupal role
Digital Signage for YMCA and the Drupal roleDmitry Drozdik
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composernuppla
 

What's hot (20)

Drupal 8 Configuration Management
Drupal 8 Configuration ManagementDrupal 8 Configuration Management
Drupal 8 Configuration Management
 
Drupal 7 for Government Case Study: Presentation at DrupalCamp Montreal 2012
Drupal 7 for Government Case Study: Presentation at DrupalCamp Montreal 2012Drupal 7 for Government Case Study: Presentation at DrupalCamp Montreal 2012
Drupal 7 for Government Case Study: Presentation at DrupalCamp Montreal 2012
 
Amplexor Drupal for the Enterprise seminar - evaluating Drupal for the Enterp...
Amplexor Drupal for the Enterprise seminar - evaluating Drupal for the Enterp...Amplexor Drupal for the Enterprise seminar - evaluating Drupal for the Enterp...
Amplexor Drupal for the Enterprise seminar - evaluating Drupal for the Enterp...
 
Drupal 7 vs. Drupal 8: A Contrast of Multilingual Support
Drupal 7 vs. Drupal 8: A Contrast of Multilingual SupportDrupal 7 vs. Drupal 8: A Contrast of Multilingual Support
Drupal 7 vs. Drupal 8: A Contrast of Multilingual Support
 
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-NapocaCMI 2.0 session at Drupal DevDays in Cluj-Napoca
CMI 2.0 session at Drupal DevDays in Cluj-Napoca
 
Drupal 8 Vocabulary Lesson
Drupal 8 Vocabulary LessonDrupal 8 Vocabulary Lesson
Drupal 8 Vocabulary Lesson
 
What is Drupal? An Introduction to Drupal 8
What is Drupal? An Introduction to Drupal 8What is Drupal? An Introduction to Drupal 8
What is Drupal? An Introduction to Drupal 8
 
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
[Srijan Wednesday Webinar] How to Run Stateless and Stateful Services on K8S ...
 
Don’t fight with windmills. Upgrade path tool from OpenY distro - Igor Karpil...
Don’t fight with windmills. Upgrade path tool from OpenY distro - Igor Karpil...Don’t fight with windmills. Upgrade path tool from OpenY distro - Igor Karpil...
Don’t fight with windmills. Upgrade path tool from OpenY distro - Igor Karpil...
 
10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box10 New Things You Can Do with Drupal 8 Out-of-the-Box
10 New Things You Can Do with Drupal 8 Out-of-the-Box
 
Drupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of TartuDrupal case study: Behind the scenes of website of University of Tartu
Drupal case study: Behind the scenes of website of University of Tartu
 
Code driven development in drupal
Code driven development in drupalCode driven development in drupal
Code driven development in drupal
 
MongoDB Jump Start
MongoDB Jump StartMongoDB Jump Start
MongoDB Jump Start
 
Drupal contributor HOWTO
Drupal contributor HOWTODrupal contributor HOWTO
Drupal contributor HOWTO
 
Drupal + composer = new love !?
Drupal + composer = new love !?Drupal + composer = new love !?
Drupal + composer = new love !?
 
World is changed. i feel it in the front end
World is changed. i feel it in the front endWorld is changed. i feel it in the front end
World is changed. i feel it in the front end
 
Presentation on octobercms
Presentation on octobercmsPresentation on octobercms
Presentation on octobercms
 
Drupal 8 - A Brief Introduction
Drupal 8 - A Brief IntroductionDrupal 8 - A Brief Introduction
Drupal 8 - A Brief Introduction
 
Digital Signage for YMCA and the Drupal role
Digital Signage for YMCA and the Drupal roleDigital Signage for YMCA and the Drupal role
Digital Signage for YMCA and the Drupal role
 
Efficient development workflows with composer
Efficient development workflows with composerEfficient development workflows with composer
Efficient development workflows with composer
 

Viewers also liked

Beyond the web: Mobile apps using Drupal & Ionic 2 - Drupal Dev Days Seville ...
Beyond the web: Mobile apps using Drupal & Ionic 2 - Drupal Dev Days Seville ...Beyond the web: Mobile apps using Drupal & Ionic 2 - Drupal Dev Days Seville ...
Beyond the web: Mobile apps using Drupal & Ionic 2 - Drupal Dev Days Seville ...La Drupalera
 
QA on Drupal projects - Drupal Dev Days Seville 2017
QA on Drupal projects - Drupal Dev Days Seville 2017QA on Drupal projects - Drupal Dev Days Seville 2017
QA on Drupal projects - Drupal Dev Days Seville 2017La Drupalera
 
Responsive testing in Drupal - Drupal Developer Days
Responsive testing in Drupal - Drupal Developer DaysResponsive testing in Drupal - Drupal Developer Days
Responsive testing in Drupal - Drupal Developer DaysLa Drupalera
 
XML Sitemap Drupal Module
XML Sitemap Drupal ModuleXML Sitemap Drupal Module
XML Sitemap Drupal ModuleLa Drupalera
 
Docker, your best ally to migrate & upgrading your Drupal - Drupal Dev Days S...
Docker, your best ally to migrate & upgrading your Drupal - Drupal Dev Days S...Docker, your best ally to migrate & upgrading your Drupal - Drupal Dev Days S...
Docker, your best ally to migrate & upgrading your Drupal - Drupal Dev Days S...La Drupalera
 
¡This is drupal! - Global Training Days
¡This is drupal! - Global Training Days¡This is drupal! - Global Training Days
¡This is drupal! - Global Training DaysLa Drupalera
 

Viewers also liked (6)

Beyond the web: Mobile apps using Drupal & Ionic 2 - Drupal Dev Days Seville ...
Beyond the web: Mobile apps using Drupal & Ionic 2 - Drupal Dev Days Seville ...Beyond the web: Mobile apps using Drupal & Ionic 2 - Drupal Dev Days Seville ...
Beyond the web: Mobile apps using Drupal & Ionic 2 - Drupal Dev Days Seville ...
 
QA on Drupal projects - Drupal Dev Days Seville 2017
QA on Drupal projects - Drupal Dev Days Seville 2017QA on Drupal projects - Drupal Dev Days Seville 2017
QA on Drupal projects - Drupal Dev Days Seville 2017
 
Responsive testing in Drupal - Drupal Developer Days
Responsive testing in Drupal - Drupal Developer DaysResponsive testing in Drupal - Drupal Developer Days
Responsive testing in Drupal - Drupal Developer Days
 
XML Sitemap Drupal Module
XML Sitemap Drupal ModuleXML Sitemap Drupal Module
XML Sitemap Drupal Module
 
Docker, your best ally to migrate & upgrading your Drupal - Drupal Dev Days S...
Docker, your best ally to migrate & upgrading your Drupal - Drupal Dev Days S...Docker, your best ally to migrate & upgrading your Drupal - Drupal Dev Days S...
Docker, your best ally to migrate & upgrading your Drupal - Drupal Dev Days S...
 
¡This is drupal! - Global Training Days
¡This is drupal! - Global Training Days¡This is drupal! - Global Training Days
¡This is drupal! - Global Training Days
 

Similar to Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017

Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 ThemeMinimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 ThemeSuzanne Dergacheva
 
Top tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceTop tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceJoomlaDay Australia
 
Know the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css frameworkKnow the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css frameworkOmkarsoft Bangalore
 
Developing Custom WordPress Themes for Clients
Developing Custom WordPress Themes for ClientsDeveloping Custom WordPress Themes for Clients
Developing Custom WordPress Themes for ClientsSteven Slack
 
Architecting with Style
Architecting with StyleArchitecting with Style
Architecting with StyleTimothy Knight
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSSanjoy Kr. Paul
 
Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Thomas Daly
 
concrete5 from developer perspective
concrete5 from developer perspectiveconcrete5 from developer perspective
concrete5 from developer perspectivemainio
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Mediacurrent
 
Drupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon BarcelonaDrupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon Barcelonahernanibf
 
Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2Acquia
 
Discover the Top 23 CSS Frameworks for 2023.pdf
Discover the Top 23 CSS Frameworks for 2023.pdfDiscover the Top 23 CSS Frameworks for 2023.pdf
Discover the Top 23 CSS Frameworks for 2023.pdfpcloudy2
 
SharePoint development 2017 wrap-up
SharePoint development   2017 wrap-upSharePoint development   2017 wrap-up
SharePoint development 2017 wrap-upJoel Rodrigues
 
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon BaltimoreCreating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon BaltimoreSuzanne Dergacheva
 
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slidesKeep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slidesJer Clarke
 
Schaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site DefinitionsSchaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site Definitionsmferraz
 
CalArts presentation
CalArts presentationCalArts presentation
CalArts presentationAshok Modi
 

Similar to Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017 (20)

Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 ThemeMinimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
 
A forest of designs without subthemes
A forest of designs without subthemesA forest of designs without subthemes
A forest of designs without subthemes
 
Top tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experienceTop tips from what we've learned from our 10 years experience
Top tips from what we've learned from our 10 years experience
 
Know the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css frameworkKnow the reason behind choosing bootstrap as css framework
Know the reason behind choosing bootstrap as css framework
 
Developing Custom WordPress Themes for Clients
Developing Custom WordPress Themes for ClientsDeveloping Custom WordPress Themes for Clients
Developing Custom WordPress Themes for Clients
 
Architecting with Style
Architecting with StyleArchitecting with Style
Architecting with Style
 
Structuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSSStructuring your CSS for maintainability: rules and guile lines to write CSS
Structuring your CSS for maintainability: rules and guile lines to write CSS
 
Developing Branding Solutions for 2013
Developing Branding Solutions for 2013Developing Branding Solutions for 2013
Developing Branding Solutions for 2013
 
concrete5 from developer perspective
concrete5 from developer perspectiveconcrete5 from developer perspective
concrete5 from developer perspective
 
Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG) Atlanta Drupal User Group (ADUG)
Atlanta Drupal User Group (ADUG)
 
Drupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon BarcelonaDrupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon Barcelona
 
Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2Drupal Step-by-Step: How We Built Our Training Site, Part 2
Drupal Step-by-Step: How We Built Our Training Site, Part 2
 
Discover the Top 23 CSS Frameworks for 2023.pdf
Discover the Top 23 CSS Frameworks for 2023.pdfDiscover the Top 23 CSS Frameworks for 2023.pdf
Discover the Top 23 CSS Frameworks for 2023.pdf
 
SharePoint development 2017 wrap-up
SharePoint development   2017 wrap-upSharePoint development   2017 wrap-up
SharePoint development 2017 wrap-up
 
The Technical Side of Harvard.edu Redesign
The Technical Side of Harvard.edu RedesignThe Technical Side of Harvard.edu Redesign
The Technical Side of Harvard.edu Redesign
 
Drupal - Introduction to Drupal Creating Modules
Drupal - Introduction to Drupal Creating ModulesDrupal - Introduction to Drupal Creating Modules
Drupal - Introduction to Drupal Creating Modules
 
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon BaltimoreCreating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
Creating Landing Pages and Layouts for Drupal 8 - DrupalCon Baltimore
 
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slidesKeep Your Code Organized! WordCamp Montreal 2013 Presentation slides
Keep Your Code Organized! WordCamp Montreal 2013 Presentation slides
 
Schaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site DefinitionsSchaeflein Dev409 Enterprise Branding Using Site Definitions
Schaeflein Dev409 Enterprise Branding Using Site Definitions
 
CalArts presentation
CalArts presentationCalArts presentation
CalArts presentation
 

More from La Drupalera

QA en SEO: Amigos con derecho a roce - Drupalcamp 2019
QA en SEO: Amigos con derecho a roce - Drupalcamp 2019QA en SEO: Amigos con derecho a roce - Drupalcamp 2019
QA en SEO: Amigos con derecho a roce - Drupalcamp 2019La Drupalera
 
Consejos y trucos para cualificar una oportunidad Drupal
Consejos y trucos para cualificar una oportunidad DrupalConsejos y trucos para cualificar una oportunidad Drupal
Consejos y trucos para cualificar una oportunidad DrupalLa Drupalera
 
Designer vs Front-end - DrupalCampES 2018 Alicante
Designer vs Front-end - DrupalCampES 2018 AlicanteDesigner vs Front-end - DrupalCampES 2018 Alicante
Designer vs Front-end - DrupalCampES 2018 AlicanteLa Drupalera
 
¡Ojo al dato!: Cómo evitar microinfartos a la gente de marketing - DrupalCamp...
¡Ojo al dato!: Cómo evitar microinfartos a la gente de marketing - DrupalCamp...¡Ojo al dato!: Cómo evitar microinfartos a la gente de marketing - DrupalCamp...
¡Ojo al dato!: Cómo evitar microinfartos a la gente de marketing - DrupalCamp...La Drupalera
 
PSD to HTML (Drupal) - Drupal Day Spain 2017 Cáceres
PSD to HTML (Drupal) - Drupal Day Spain 2017 CáceresPSD to HTML (Drupal) - Drupal Day Spain 2017 Cáceres
PSD to HTML (Drupal) - Drupal Day Spain 2017 CáceresLa Drupalera
 
Tips para posicionarte como desarrollador Drupal - Drupal Day Spain 2017 Cáceres
Tips para posicionarte como desarrollador Drupal - Drupal Day Spain 2017 CáceresTips para posicionarte como desarrollador Drupal - Drupal Day Spain 2017 Cáceres
Tips para posicionarte como desarrollador Drupal - Drupal Day Spain 2017 CáceresLa Drupalera
 
Tu drupal está listo… ¿lo sabe Google? - DrupalCamp 2017
Tu drupal está listo… ¿lo sabe Google? - DrupalCamp 2017Tu drupal está listo… ¿lo sabe Google? - DrupalCamp 2017
Tu drupal está listo… ¿lo sabe Google? - DrupalCamp 2017La Drupalera
 
QA on drupal projects
QA on drupal projectsQA on drupal projects
QA on drupal projectsLa Drupalera
 
¿Cómo aplicar una estrategia de Marketing efectiva basada en Drupal?
¿Cómo aplicar una estrategia de Marketing efectiva basada en Drupal?¿Cómo aplicar una estrategia de Marketing efectiva basada en Drupal?
¿Cómo aplicar una estrategia de Marketing efectiva basada en Drupal?La Drupalera
 
Drupal vs Wordpress
Drupal vs WordpressDrupal vs Wordpress
Drupal vs WordpressLa Drupalera
 
Marketing, Comunidad, Empleo y Negocio Internacional basado en Drupal
Marketing, Comunidad, Empleo y Negocio Internacional basado en DrupalMarketing, Comunidad, Empleo y Negocio Internacional basado en Drupal
Marketing, Comunidad, Empleo y Negocio Internacional basado en DrupalLa Drupalera
 
Caso de éxito Drupal - Procomún - DrupalCamp Spain 2016
Caso de éxito Drupal - Procomún - DrupalCamp Spain 2016Caso de éxito Drupal - Procomún - DrupalCamp Spain 2016
Caso de éxito Drupal - Procomún - DrupalCamp Spain 2016La Drupalera
 
Desplegando código con Phing, PHPunit, Coder y Jenkins
Desplegando código con Phing, PHPunit, Coder y JenkinsDesplegando código con Phing, PHPunit, Coder y Jenkins
Desplegando código con Phing, PHPunit, Coder y JenkinsLa Drupalera
 

More from La Drupalera (13)

QA en SEO: Amigos con derecho a roce - Drupalcamp 2019
QA en SEO: Amigos con derecho a roce - Drupalcamp 2019QA en SEO: Amigos con derecho a roce - Drupalcamp 2019
QA en SEO: Amigos con derecho a roce - Drupalcamp 2019
 
Consejos y trucos para cualificar una oportunidad Drupal
Consejos y trucos para cualificar una oportunidad DrupalConsejos y trucos para cualificar una oportunidad Drupal
Consejos y trucos para cualificar una oportunidad Drupal
 
Designer vs Front-end - DrupalCampES 2018 Alicante
Designer vs Front-end - DrupalCampES 2018 AlicanteDesigner vs Front-end - DrupalCampES 2018 Alicante
Designer vs Front-end - DrupalCampES 2018 Alicante
 
¡Ojo al dato!: Cómo evitar microinfartos a la gente de marketing - DrupalCamp...
¡Ojo al dato!: Cómo evitar microinfartos a la gente de marketing - DrupalCamp...¡Ojo al dato!: Cómo evitar microinfartos a la gente de marketing - DrupalCamp...
¡Ojo al dato!: Cómo evitar microinfartos a la gente de marketing - DrupalCamp...
 
PSD to HTML (Drupal) - Drupal Day Spain 2017 Cáceres
PSD to HTML (Drupal) - Drupal Day Spain 2017 CáceresPSD to HTML (Drupal) - Drupal Day Spain 2017 Cáceres
PSD to HTML (Drupal) - Drupal Day Spain 2017 Cáceres
 
Tips para posicionarte como desarrollador Drupal - Drupal Day Spain 2017 Cáceres
Tips para posicionarte como desarrollador Drupal - Drupal Day Spain 2017 CáceresTips para posicionarte como desarrollador Drupal - Drupal Day Spain 2017 Cáceres
Tips para posicionarte como desarrollador Drupal - Drupal Day Spain 2017 Cáceres
 
Tu drupal está listo… ¿lo sabe Google? - DrupalCamp 2017
Tu drupal está listo… ¿lo sabe Google? - DrupalCamp 2017Tu drupal está listo… ¿lo sabe Google? - DrupalCamp 2017
Tu drupal está listo… ¿lo sabe Google? - DrupalCamp 2017
 
QA on drupal projects
QA on drupal projectsQA on drupal projects
QA on drupal projects
 
¿Cómo aplicar una estrategia de Marketing efectiva basada en Drupal?
¿Cómo aplicar una estrategia de Marketing efectiva basada en Drupal?¿Cómo aplicar una estrategia de Marketing efectiva basada en Drupal?
¿Cómo aplicar una estrategia de Marketing efectiva basada en Drupal?
 
Drupal vs Wordpress
Drupal vs WordpressDrupal vs Wordpress
Drupal vs Wordpress
 
Marketing, Comunidad, Empleo y Negocio Internacional basado en Drupal
Marketing, Comunidad, Empleo y Negocio Internacional basado en DrupalMarketing, Comunidad, Empleo y Negocio Internacional basado en Drupal
Marketing, Comunidad, Empleo y Negocio Internacional basado en Drupal
 
Caso de éxito Drupal - Procomún - DrupalCamp Spain 2016
Caso de éxito Drupal - Procomún - DrupalCamp Spain 2016Caso de éxito Drupal - Procomún - DrupalCamp Spain 2016
Caso de éxito Drupal - Procomún - DrupalCamp Spain 2016
 
Desplegando código con Phing, PHPunit, Coder y Jenkins
Desplegando código con Phing, PHPunit, Coder y JenkinsDesplegando código con Phing, PHPunit, Coder y Jenkins
Desplegando código con Phing, PHPunit, Coder y Jenkins
 

Recently uploaded

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 

Recently uploaded (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 

Efficiently theming a multi-site Drupal 8 portal - Drupal Dev Days Seville 2017

  • 1. Efficiently theming a multi-site Drupal 8 portal How a single Drupal theme can be used for a complex multi-site Drupal installation
  • 2. Hello everyone, we are... Nesta (@Nesta_) Technical Architect and QA 8+ years working with Drupal Enno (@langelotz) Frontend Developer, SEO specialist 7+ years working with Drupal La Drupalera (@ladrupalera) One of the premier Drupal agencies in Spain with headquarters in Seville.
  • 3. Drupal 8 Multisite 3 Considering using a single theme for a Drupal 8 multisite environment Critical points: ● similar branding and styles? ● common navigation elements? ● overlapping content? Drupal 8 Multisite 2 Drupal 8 Multisite 1 Shared code Theme 1 Theme 2 Theme 3
  • 4. Drupal 8 Multisite 3 Similarities for the individual sites can justify the use of a single theme Critical points: ● similar branding and styles ● common navigation elements ● overlapping content Drupal 8 Multisite 2 Drupal 8 Multisite 1 Shared code Theme 1
  • 5. Real life example: Sevilla FC Highly visible futbol portal > 500k visits/month 3 portals in a multisite installation 13 different languages
  • 6. Functional requirements for our single theme Customer 1: “We want everything to look the same, but portal 1 has an additional sidebar.” Customer 2: “We have a general company branding, but each department with its own subsite has its own logo and colors.” Customer 3: “One of our portals has special content, which has its own design different from our general style guide.”
  • 7. Technical requirements ● Create custom CSS/JS for each portal of the multisite installation ● Don’t create unnecessary or duplicate CSS ● Have a technical solution for whatever design exception is thrown at us during the development cycle ● Be able to modify styles for any region/page/node/block in any site at any point in time without being worried about side effects
  • 8. Rules, that help the team work together and create a better product ● Empower your frontend developers to allow them making informed decisions ● Separate general components (your style guide) from block/page specific design ● Have a specific task for the theme setup that solves basic theme foundations such as grid, typography, variables, theme structure and common elements ● Talk to each other, so you can help each other out with reusable code
  • 9. The Theme basis we work with ● Gulp/Grunt for CSS/JS creation ● No predefined framework like Bootstrap - we use individual external libraries as needed. Examples: ○ Susy ○ Breakpoint ● Sass as our preprocessor of choice ● Sass archive hierarchy loosely based on SMACSS, but Drupal specific
  • 10. Sass to the rescue Sass allows us to import or write our Code in small chunks and different archives and then put it all together for the final compilation into css. For a single site installation, everything is brought together in one central file: main.sass @import external libraries @import utilities @import base styles @import layout
  • 11. Using a strict Sass archive hierarchy The theme defines the basic approach: ● Hierarchical structure of folders ● Archives for basic components ● Order of compilation ● Imported code The frontend developer decides: ● Level of implementation: Page, view, block, node, etc. ● Use of mixins and extends Sass External Utilities Base Components Layout Blocks Views Pages Nodes
  • 12. Code example 1 Drupal 8 Sass Folder structure in Editor
  • 13. Questions for the frontend developer Main Content Sidebar Header Static Block View Node Footer Decision Tree Example Project Manager: “Apply the necessary styles to the sidebar!” What is my content in the sidebar? Custom block and view. -> Divide the tasks Is my custom block used anywhere else on the portal? No -> Create Sass file for the block, insert the styles. Is my view using nodes or fields? Node teasers. Are the node teasers used anywhere on the side in a different context? No -> Create node teaser twig template and Sass archive. Node
  • 14. Workflow in abstract form 1. Receive the task 2. Analyze the situation 3. Define and create necessary Sass files to work on 4. Create/adapt mixins/extends/functions/variables 5. Create the specific styles
  • 15. Creating and using the individual Sass archive Example: Drupal Search block Folder for the block Sass file: layout/blocks .search-block-form = _block-search-block-form.sass Important rule for determining the right context: No styles allowed that cannot be inserted by using “.search-block-form” as the first css class. .page-node-15 .search-block-form <- We don’t want that!
  • 16. Code example 2 Example Sevilla FC - Block Pasion Sevillista Identifying and changing a Sass file
  • 17. Taking care of the multisite optional styles We will need optional styles for each subsite. Our main.sass file stops being the all-including style file. main.sass - Contains all basic styles layout-default.sass - Contains the default layout styles site1.sass - Contains only site-specific styles The layout folder is duplicated for each subsite.
  • 18. Where to put the code on multisite? Decision Tree Example Project Manager: “Apply the necessary styles to the sidebar!” What is my content in the sidebar? Custom block and view. -> Divide the tasks Are the styles specific to one/several subsites or generally applicable ? Specific to one side -> Use the Sass folder for the specific site Is my custom block used anywhere else on the portal? No -> Create Sass file for the block, insert the styles.
  • 19. Further theme preprocess changes for multisite Additional css classes for the <body> element can help adding specific styles more easily. <body> CSS class for: ● Subsite ● Language ● Node ID
  • 20. Code example 3 a) Multisite folder structure example. b) Adapted theme.libraries file to create the necessary multisite css. c) Preprocess changes in the theme to add body classes
  • 21. Room for optimization - get feedback from frontend Don’t wait with the Sass/CSS until after Sitebuilding is finished! Your frontend developer can help to shorten the process by pointing out simple HTML changes that can be achieved by: ● Changing views to use global fields ● Creating custom node displays ● Adding css IDs/classes ● Changing the order of blocks/panels/paragraphs ● Adding or removing containers that are set with DS, Panels or similar
  • 22. Thank you very much for your attention. Questions?