SlideShare a Scribd company logo
Drupal 8 Theming
Templating
First step
• First we need to create a THEMENAME.info.yml file
to craete a new theme.
• This file provides the metadata about the new
theme.
THEMENAME.info.yml
• 4 required meta information
 Name
 Description
 Type
 Core
Some additional meta info which can be added :
 Libraries
 Stylesheet-remove
 Regions
THEMENAME.info.yml
• name: Fluffiness
• description: First custom theme for drupal8
• type: theme
• core: 8.x
• stylesheets-remove:
- core/assets/vendor/normalize-css/normalize.css
• libraries:
- fluffiness/global-styling
• regions:
header: 'Header'
content: 'Content'
page_top: 'Pag Top'
page_bottoml: 'Page Bottom'
footer: 'footer'
Libraries
• No stylesheets property
• No scripts property
• jQuery is not automatically loaded on all pages anymore in Drupal 8
• To define your asset libraries you need to add THEMENAME.libraries.yml
In this library yml file we can add the required css/js files as below eg:
cuddly-slider:
version: 1.x
css:
theme:
css/cuddly-slider.css: {}
js:
js/cuddly-slider.js: {}
dependencies:
- core/jquery
regions
• To add a region to a theme there are 2 require steps :
 Adding region metadata to your THEMENAME.info.yml
 print that new region into the page.html.twig file.
For example :
region :
header_top : Header Top
Print this new region in your twig template
{{page.header_top}}
Default Regions
1. page.header: Items for the header region.
2. page.primary_menu: Items for the primary menu region.
3. page.secondary_menu: Items for the secondary menu region.
4. page.highlighted: Items for the highlighted content region.
5. page.help: Dynamic help text, mostly for admin pages.
6. page.content: The main content of the current page.
7. page.sidebar_first: Items for the first sidebar.
8. page.sidebar_second: Items for the second sidebar.
9. page.footer: Items for the footer region.
10. page.breadcrumb: Items for the breadcrumb region.
These are 10 default regions coming from base theme classic.
Twig templates
• page.html.twig
• html.html.twig

More Related Content

PPTX
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
PPTX
WordPress Themes 101 - HighEdWeb New England 2013
PPTX
WordPress Themes 101 - dotEduGuru Summit 2013
PPTX
Towards an Alternate WordPress Theme Structure
KEY
Custom Field Formatters
PDF
WordPress Theme Workshop: Part 2
PPT
Wordpress template hierarchy
PPTX
Jekyll Theming
Writing a WordPress Theme - HighEdWeb 2013 #WRK2
WordPress Themes 101 - HighEdWeb New England 2013
WordPress Themes 101 - dotEduGuru Summit 2013
Towards an Alternate WordPress Theme Structure
Custom Field Formatters
WordPress Theme Workshop: Part 2
Wordpress template hierarchy
Jekyll Theming

What's hot (14)

ODP
Drupal Multi-site for Fun and Profit
PPSX
WordPress Theme Design and Development Workshop - Day 2
PPTX
WordPress Theme Development
PPT
Open Source Content Management Systems
PPTX
WordPress Template hierarchy
PDF
WordPress Template Hierarchy
PDF
Data cache management in php
PDF
A Custom Drupal Theme in 40 Minutes
PDF
Drupal Multisite Setup
KEY
Drupal Multisite
PDF
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
PPTX
Design todevelop
PPTX
Drupal Camp Porto - Developing with Drupal: First Steps
PDF
PHP Includes
Drupal Multi-site for Fun and Profit
WordPress Theme Design and Development Workshop - Day 2
WordPress Theme Development
Open Source Content Management Systems
WordPress Template hierarchy
WordPress Template Hierarchy
Data cache management in php
A Custom Drupal Theme in 40 Minutes
Drupal Multisite Setup
Drupal Multisite
Minimalist Theming: How to Build a Lean, Mean Drupal 8 Theme
Design todevelop
Drupal Camp Porto - Developing with Drupal: First Steps
PHP Includes
Ad

Viewers also liked (14)

PPSX
4t A SG-Barcelona
PDF
Martin Junker - Media PR
PDF
Introduction to Grid Generation
PPT
Clasicismo y concreto armado fm
PPTX
Blessings From Scripture Study
PPTX
Mobile App Security: A Review
PDF
PDF
Sistemasdeinformación
PPT
Euglenoidne alge
PPT
Bacillariophyta
PDF
Propuesta mejoramiento organizacional
4t A SG-Barcelona
Martin Junker - Media PR
Introduction to Grid Generation
Clasicismo y concreto armado fm
Blessings From Scripture Study
Mobile App Security: A Review
Sistemasdeinformación
Euglenoidne alge
Bacillariophyta
Propuesta mejoramiento organizacional
Ad

Similar to Drupal 8 theming (20)

PPTX
Drupal Theming for Developers
PDF
Drupal 8 - Corso frontend development
PPTX
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
PDF
Keycloak theme customization
KEY
PSD to Drupal - Introductory Drupal Theming
PPTX
Drupal theming
PDF
Drupal8 themingdeepdive drupaldevdays-montpellier17042015
PDF
Drupal theming - a practical approach (European Drupal Days 2015)
PDF
Drupal 8: frontend development
PPTX
WortdPress Child themes: Why and How
PDF
Drupal 8: Theming. Lviv Drupal Cafe #4
PPTX
D8 training
PPT
Drupal 6 Theming
PDF
Introduction To Drupal
PDF
Drupal Theming An Introduction
PDF
Drupal 8 theming deep dive
PPT
Themes and layouts
PPT
Drupal7 themeing changes and inheritence
PPTX
Theming Drupal 6 - An Introduction to the Basics
PDF
Creating and Theming Custom Content Types
Drupal Theming for Developers
Drupal 8 - Corso frontend development
DrupalTour Lviv — Theming in Drupal8 (Ivan Tibezh, InternetDevels)
Keycloak theme customization
PSD to Drupal - Introductory Drupal Theming
Drupal theming
Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal theming - a practical approach (European Drupal Days 2015)
Drupal 8: frontend development
WortdPress Child themes: Why and How
Drupal 8: Theming. Lviv Drupal Cafe #4
D8 training
Drupal 6 Theming
Introduction To Drupal
Drupal Theming An Introduction
Drupal 8 theming deep dive
Themes and layouts
Drupal7 themeing changes and inheritence
Theming Drupal 6 - An Introduction to the Basics
Creating and Theming Custom Content Types

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
Teaching material agriculture food technology
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
A Presentation on Artificial Intelligence
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Assigned Numbers - 2025 - Bluetooth® Document
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
gpt5_lecture_notes_comprehensive_20250812015547.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Teaching material agriculture food technology
A comparative analysis of optical character recognition models for extracting...
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
A Presentation on Artificial Intelligence
The AUB Centre for AI in Media Proposal.docx
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Dropbox Q2 2025 Financial Results & Investor Presentation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Encapsulation_ Review paper, used for researhc scholars
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Chapter 3 Spatial Domain Image Processing.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
“AI and Expert System Decision Support & Business Intelligence Systems”
Assigned Numbers - 2025 - Bluetooth® Document

Drupal 8 theming

  • 2. First step • First we need to create a THEMENAME.info.yml file to craete a new theme. • This file provides the metadata about the new theme.
  • 3. THEMENAME.info.yml • 4 required meta information  Name  Description  Type  Core Some additional meta info which can be added :  Libraries  Stylesheet-remove  Regions
  • 4. THEMENAME.info.yml • name: Fluffiness • description: First custom theme for drupal8 • type: theme • core: 8.x • stylesheets-remove: - core/assets/vendor/normalize-css/normalize.css • libraries: - fluffiness/global-styling • regions: header: 'Header' content: 'Content' page_top: 'Pag Top' page_bottoml: 'Page Bottom' footer: 'footer'
  • 5. Libraries • No stylesheets property • No scripts property • jQuery is not automatically loaded on all pages anymore in Drupal 8 • To define your asset libraries you need to add THEMENAME.libraries.yml In this library yml file we can add the required css/js files as below eg: cuddly-slider: version: 1.x css: theme: css/cuddly-slider.css: {} js: js/cuddly-slider.js: {} dependencies: - core/jquery
  • 6. regions • To add a region to a theme there are 2 require steps :  Adding region metadata to your THEMENAME.info.yml  print that new region into the page.html.twig file. For example : region : header_top : Header Top Print this new region in your twig template {{page.header_top}}
  • 7. Default Regions 1. page.header: Items for the header region. 2. page.primary_menu: Items for the primary menu region. 3. page.secondary_menu: Items for the secondary menu region. 4. page.highlighted: Items for the highlighted content region. 5. page.help: Dynamic help text, mostly for admin pages. 6. page.content: The main content of the current page. 7. page.sidebar_first: Items for the first sidebar. 8. page.sidebar_second: Items for the second sidebar. 9. page.footer: Items for the footer region. 10. page.breadcrumb: Items for the breadcrumb region. These are 10 default regions coming from base theme classic.