SlideShare une entreprise Scribd logo
1  sur  61
Télécharger pour lire hors ligne
Subtitel
1
© Ibuildings 2014/2015 - All rights reserved
#DrupalDaysEU
DRUPAL THEMING -
a practical approach
by Chris Jansen
#DrupalDaysEU
© Ibuildings 2014/2015 - All rights reserved
Gold Sponsors
#DrupalDaysEU
© Ibuildings 2014/2015 - All rights reserved
Media Sponsors
Silver Sponsors
A practical approach to the basics
Chris Jansen
20 march 2015, Milan
Drupal theming
About me
5
About me
6
Topics
Tools and materials
Introducing basic concepts
Design breakdown
Creating the theme
Common mistakes
7
Tools and materials
8
Tools
Virtualbox
Vagrant
9
Materials
Git repository
Slides on slideshare
Install virtualbox and vagrant
http://www.vagrantup.com/downloads
https://www.virtualbox.org/wiki/Downloads
10
Copy image
Supplied on several USB sticks
Boot VM
vagrant up
Access drupal site
192.168.33.10
user: admin
pass: admin
11
Access server
vagrant ssh
Docroot on server
/vagrant/public/ == /var/www/public
Introducing basic
concepts
12
Introducing basic concepts
• Directory layout
• Basic theme elements
• Entities & view modes
• Render arrays
• Hooks
• Render process
• Overriding theme functions
• Overriding templates
13
Directory layout
14
drupal.org/project/*
Custom and/or
sandbox modules.
Modules created by
the features module.
Custom and/or
contributed themes.
Best practice
Basic theme elements
• Regions
• Blocks
• Logo
• Site name & slogan
• Main/Secondary menu
15
Entities & view modes
Entities are stored information (usually
content)
• Nodes
• Taxonomy terms
• Users
• etc.
16
Entities & view modes
View modes are different ways to display
entities
• Node
• Full (Default view mode)
• Teaser (configurable by default)
• Rss
• Taxonomy
• Taxonomy term page (Default view mode)
• User
• User account (Default view mode)
• etc.
17
Uitwerken
Adding your own view modes
Create a custom module
• Implement hook_entity_info_alter()
Use contrib module:
• Entity View Mode
• https://www.drupal.org/project/entity_view_mode
• Display suite
• https://www.drupal.org/project/ds
18
Keyed array of data
• #Propery or #value
• Child
Render arrays - WHAT?
19
render()
theme_container()
drupal_attributes()
render()
Render arrays - HOW?
Properties
• What to render
• How to render it
Children
• What to include within
20
Properties
• What to render
• How to render it
render()
theme_item_list()
drupal_attributes()
drupal_process_attached()
Render arrays - HOW?
21
Render arrays - HOW?
Properties
• What to render
• How to render it
22
render()
Render arrays - WHY?
Data can be changed, markup can not.
• Change positioning
• Add/Change/Remove values
23
Render arrays - WHY?
Data can be changed, markup can not.
• Change positioning
• Add/Change/Remove values
24
Hooks
hook_*
• Modules only
hook_*_alter
• Modules
• Themes
template_*
• Modules
• Themes
theme_*
• Themes
25
Module
Base theme
Subtheme
Current theme
Theme function
• Fast
• Limited (pre)processing
• theme_*()
Template
• Flexible
• *.tpl.php
Render process
theme()
26
render aray
theme function template
HTML
process

template_process_*
preprocess

template_preprocess_*
Overriding theme functions
Overrides live in template.php
Copy & rename original theme function
• theme_item_list -> themename_item_list
Alter the function to suit your needs.
Clear cache
27
Overriding templates
Copy template file to your theme folder
• modules/block/block.tpl.php -> sites/all/
themes/yourtheme/templates/block.tpl.php
Alter the template
Clear cache
28
Best practice: Place your templates in a template folder
e.g.: ../yourtheme/templates/block.tpl.php
Design breakdown
29
Design breakdown
Identify regions
Determine additional requirements
30
Identify regions
Top bar
Main menu
Left sidebar
Main content
Footer
31
Identify regions
Top bar
Main menu
Sidebar Left & Right
Main content
Footer
32
Identify regions
Top bar
Main menu
Sidebar Left & Right
Main content
Split footer Left & Right
Footer
33
Identify regions
Top bar
Main menu
Sidebar Left & Right
Main content
Below content Left & Right
Footer
34
Determine additional requirements
Browser support
Slideshows
Fancy menu’s
etc.
35
Creating the theme
36
Where to start
Buy a theme
Start from scratch
Subtheme
• Start from scratch
• Starterkit
37
Creating the theme
Creating the .info file
• Theme from scratch
• Subtheme from scratch
• Define regions
• Define CSS/JS
‣ Override/disable CSS/JS
Other ways to add CSS/JS
Alter markup using templates
38
Theme from scratch
Required keys
• name
• core
Recommended keys
• description
Commonly used optional keys
• base theme
• stylesheets
• scripts
39
Subtheme from scratch
Required keys
• name
• core
Recommended keys
• description
Commonly used optional keys
• base theme
• stylesheets
• scripts
40
Exercises
41
1. Create a new theme
2. Change your theme to be a Zen subtheme
3. Compare your subtheme to Zen, what do you
notice?
Subtheme compared to Zen
Different regions
• Unless defined otherwise Drupal assumes
default regions: Header, Highlighted, Help,
Content, Left sidebar, Right sidebar, Footer
No stylesheets
• All stylesheets defined in basetheme.info are
inherited, but only if at least one stylesheet has
been defined in mytheme.info
• Zen conditionally defines stylesheets in
hook_preprocess_html
No Logo
42
Add region to .info file
Clear caches
Print the region in page.tpl.php
Define regions
43
Best practice: Place your templates in a template folder
e.g.: ../yourtheme/templates/block.tpl.php
Exercises
44
1. Add zen’s regions to your info file
2. Add a custom region to your info file
3. Render the region in page.tpl.php
Hints:
• Copy zen’s page.tpl.php
• git checkout ex-1 for previous
exercise results
Define CSS/JS
Add CSS/JS to info file
Clear Caches
45
Other ways to add CSS/JS
Functions to use
• using drupal_add_css()
• using drupal_add_js()
• using [‘#attached’] in a render array()
Where to use them
• hook_preprocess_HOOK()
• hook_process_HOOK()
• hook_TYPE_alter()
46
#attached example
Drupal_add_* example
Other ways to add CSS/JS
47
Other ways to add CSS/JS
Adding options to your JS
48
Other ways to add CSS/JS
Add/Override/Remove directly
• hook_js_alter();
• hook_css_alter();
49
Exercise
50
Experiment
1. Define CSS in info file
2. Remove/override CSS in info file
3. Add css using drupal_add_css()
4. Add a “hello world” script using
drupal_add_js()
5. Add css using [‘#attached’]
6. Add a “hello world” script using [‘#attached’]
7. Place a script in the footer.
Hints:
• git checkout ex-2 for previous
exercise results
Alter markup using templates
Lets create a two-column article.
Copy template file to your theme folder
sites/all/themes/zen/templates/node.tpl.php ->
sites/all/themes/yourtheme/templates/node.tpl.php
Alter the template
Clear cache
51
Alter markup using templates
52
Alter markup using templates
Problem!
• Template is used for all content types
Solution: suggestions
• node.tpl.php
• node--type.tpl.php
• node--type--view_mode.tpl.php (EVM)
• node--nodeid.tpl.php
• node--nodeid--view_mode.tpl.php (EVM)
53
Display the author on an article page.
• Render user with view mode teaser
• Use preprocessing
• Use a template
Exercise
54
Hints:
• user_load()
• user_view()
• $variables[‘theme_hook_suggestions’]
• git checkout ex-3 for previous exercise
results
Author name
Article title
Article text Article text
Article text Article text
Article text Article text
Article text Article text Article text
Article text Article text Article text
Article text Article text Article text
Common mistakes
55
Hacking core, modules or themes
Why not?
• Breaks upgrades
• Maintainability
• theme_*
Alternatives
• template_(pre)process_*
• hook_*_alter hooks
• theme_*
56
Advanced logic in templates
Why not?
• Templates are responsible for display only
• Difficult to get to variables
• Hard to maintain
Alternatives
• (pre)process data before it reaches the template
Only PHP you should use
• if(content_present)
• foreach($content_list as $content)
• print ($content);
57
Changing field ordering in templates
Why not?
• Hard to maintain
Alternatives
• Use view modes
58
Using global $user
Why not?
• Security!
Alternatives
• Use user_uid_optional_load()
59
Not using check_plain()/check_markup()
Why is this a problem?
• Security!
When to use them?
• Check_plain()
• Check_markup()
60
Happy theming
Thank you!
61

Contenu connexe

Tendances

Drupal 8 introduction to theming
Drupal 8  introduction to themingDrupal 8  introduction to theming
Drupal 8 introduction to themingBrahampal Singh
 
8 things to know about theming in drupal 8
8 things to know about theming in drupal 88 things to know about theming in drupal 8
8 things to know about theming in drupal 8Logan Farr
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeAdolfo Nasol
 
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep diveRomain Jarraud
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Anne Tomasevich
 
Absolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalAbsolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalRod Martin
 
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Emma Jane Hogbin Westby
 
Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Emma Jane Hogbin Westby
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Ryan Price
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentsparkfabrik
 
Drupal 8: Theming
Drupal 8: ThemingDrupal 8: Theming
Drupal 8: Themingdrubb
 
Ts drupal6 module development v0.2
Ts   drupal6 module development v0.2Ts   drupal6 module development v0.2
Ts drupal6 module development v0.2Confiz
 
Getting started with drupal 8 code
Getting started with drupal 8 codeGetting started with drupal 8 code
Getting started with drupal 8 codeForum One
 
Theme Kickstart
Theme KickstartTheme Kickstart
Theme KickstartPeter
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2Josh Lee
 
Drupal 8 templating with twig
Drupal 8 templating with twigDrupal 8 templating with twig
Drupal 8 templating with twigTaras Omelianenko
 
WordPress Themes 101 - PSUWeb13 Workshop
WordPress Themes 101 - PSUWeb13 WorkshopWordPress Themes 101 - PSUWeb13 Workshop
WordPress Themes 101 - PSUWeb13 WorkshopCurtiss Grymala
 

Tendances (20)

Drupal 8 introduction to theming
Drupal 8  introduction to themingDrupal 8  introduction to theming
Drupal 8 introduction to theming
 
8 things to know about theming in drupal 8
8 things to know about theming in drupal 88 things to know about theming in drupal 8
8 things to know about theming in drupal 8
 
Converting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 ThemeConverting (X)HTML/CSS template to Drupal 7 Theme
Converting (X)HTML/CSS template to Drupal 7 Theme
 
Drupal 8 theming deep dive
Drupal 8 theming deep diveDrupal 8 theming deep dive
Drupal 8 theming deep dive
 
Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8Building a Custom Theme in Drupal 8
Building a Custom Theme in Drupal 8
 
Design to Theme @ CMSExpo
Design to Theme @ CMSExpoDesign to Theme @ CMSExpo
Design to Theme @ CMSExpo
 
Absolute Beginners Guide to Drupal
Absolute Beginners Guide to DrupalAbsolute Beginners Guide to Drupal
Absolute Beginners Guide to Drupal
 
Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010Intro to Theming Drupal, FOSSLC Summer Camp 2010
Intro to Theming Drupal, FOSSLC Summer Camp 2010
 
Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009Learning PHP for Drupal Theming, DC Chicago 2009
Learning PHP for Drupal Theming, DC Chicago 2009
 
Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011Drupal Theme Development - DrupalCon Chicago 2011
Drupal Theme Development - DrupalCon Chicago 2011
 
Drupal 8 - Corso frontend development
Drupal 8 - Corso frontend developmentDrupal 8 - Corso frontend development
Drupal 8 - Corso frontend development
 
Building Drupal 6 Theme
Building Drupal 6 ThemeBuilding Drupal 6 Theme
Building Drupal 6 Theme
 
Drupal 8: Theming
Drupal 8: ThemingDrupal 8: Theming
Drupal 8: Theming
 
Ts drupal6 module development v0.2
Ts   drupal6 module development v0.2Ts   drupal6 module development v0.2
Ts drupal6 module development v0.2
 
Getting started with drupal 8 code
Getting started with drupal 8 codeGetting started with drupal 8 code
Getting started with drupal 8 code
 
Theme Kickstart
Theme KickstartTheme Kickstart
Theme Kickstart
 
WordPress Theme Development: Part 2
WordPress Theme Development: Part 2WordPress Theme Development: Part 2
WordPress Theme Development: Part 2
 
Drupal 8 templating with twig
Drupal 8 templating with twigDrupal 8 templating with twig
Drupal 8 templating with twig
 
WordPress Themes 101 - PSUWeb13 Workshop
WordPress Themes 101 - PSUWeb13 WorkshopWordPress Themes 101 - PSUWeb13 Workshop
WordPress Themes 101 - PSUWeb13 Workshop
 
Plone 5 theming
Plone 5 themingPlone 5 theming
Plone 5 theming
 

En vedette

Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)
Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)
Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)Eugenio Minardi
 
Drupal Security: How to survive Drupalgeddon and prepare for future (European...
Drupal Security: How to survive Drupalgeddon and prepare for future (European...Drupal Security: How to survive Drupalgeddon and prepare for future (European...
Drupal Security: How to survive Drupalgeddon and prepare for future (European...Eugenio Minardi
 
Optimizing MariaDB for Web Applications (European Drupal Days 2015)
Optimizing MariaDB for Web Applications (European Drupal Days 2015)Optimizing MariaDB for Web Applications (European Drupal Days 2015)
Optimizing MariaDB for Web Applications (European Drupal Days 2015)Eugenio Minardi
 
The multilingual Drupal 8 experience (European Drupal Days 2015)
The multilingual Drupal 8 experience (European Drupal Days 2015)The multilingual Drupal 8 experience (European Drupal Days 2015)
The multilingual Drupal 8 experience (European Drupal Days 2015)Eugenio Minardi
 
PhpStorm for Drupal Development (European Drupal Days 2015)
PhpStorm for Drupal Development (European Drupal Days 2015)PhpStorm for Drupal Development (European Drupal Days 2015)
PhpStorm for Drupal Development (European Drupal Days 2015)Eugenio Minardi
 
Sponsorship Opportunities European Drupal Days & Dutch PHP Conference 2015
Sponsorship Opportunities European Drupal Days & Dutch PHP Conference 2015Sponsorship Opportunities European Drupal Days & Dutch PHP Conference 2015
Sponsorship Opportunities European Drupal Days & Dutch PHP Conference 2015Eugenio Minardi
 
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...Eugenio Minardi
 
Secure Drupal, from start to finish (European Drupal Days 2015)
Secure Drupal, from start to finish (European Drupal Days 2015)Secure Drupal, from start to finish (European Drupal Days 2015)
Secure Drupal, from start to finish (European Drupal Days 2015)Eugenio Minardi
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Eugenio Minardi
 
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)Eugenio Minardi
 
Drupal for Big Data - is it ready? (European Drupal Days 2015)
Drupal for Big Data - is it ready? (European Drupal Days 2015)Drupal for Big Data - is it ready? (European Drupal Days 2015)
Drupal for Big Data - is it ready? (European Drupal Days 2015)Eugenio Minardi
 
Web automation with #d8rules (European Drupal Days 2015)
Web automation with #d8rules (European Drupal Days 2015)Web automation with #d8rules (European Drupal Days 2015)
Web automation with #d8rules (European Drupal Days 2015)Eugenio Minardi
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Eugenio Minardi
 
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)UN World Food Programme Standards & Best Practises (European Drupal Days 2015)
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)Eugenio Minardi
 
A Practical Introduction to Symfony (European Drupal Days 2015)
A Practical Introduction to Symfony (European Drupal Days 2015)A Practical Introduction to Symfony (European Drupal Days 2015)
A Practical Introduction to Symfony (European Drupal Days 2015)Eugenio Minardi
 

En vedette (15)

Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)
Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)
Deploying an Open Source DAM in SAAS Mode (European Drupal Days 2015)
 
Drupal Security: How to survive Drupalgeddon and prepare for future (European...
Drupal Security: How to survive Drupalgeddon and prepare for future (European...Drupal Security: How to survive Drupalgeddon and prepare for future (European...
Drupal Security: How to survive Drupalgeddon and prepare for future (European...
 
Optimizing MariaDB for Web Applications (European Drupal Days 2015)
Optimizing MariaDB for Web Applications (European Drupal Days 2015)Optimizing MariaDB for Web Applications (European Drupal Days 2015)
Optimizing MariaDB for Web Applications (European Drupal Days 2015)
 
The multilingual Drupal 8 experience (European Drupal Days 2015)
The multilingual Drupal 8 experience (European Drupal Days 2015)The multilingual Drupal 8 experience (European Drupal Days 2015)
The multilingual Drupal 8 experience (European Drupal Days 2015)
 
PhpStorm for Drupal Development (European Drupal Days 2015)
PhpStorm for Drupal Development (European Drupal Days 2015)PhpStorm for Drupal Development (European Drupal Days 2015)
PhpStorm for Drupal Development (European Drupal Days 2015)
 
Sponsorship Opportunities European Drupal Days & Dutch PHP Conference 2015
Sponsorship Opportunities European Drupal Days & Dutch PHP Conference 2015Sponsorship Opportunities European Drupal Days & Dutch PHP Conference 2015
Sponsorship Opportunities European Drupal Days & Dutch PHP Conference 2015
 
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...
The benefits of an elastic infrastructure on a Drupal e-commerce (European Dr...
 
Secure Drupal, from start to finish (European Drupal Days 2015)
Secure Drupal, from start to finish (European Drupal Days 2015)Secure Drupal, from start to finish (European Drupal Days 2015)
Secure Drupal, from start to finish (European Drupal Days 2015)
 
Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...Bridging the gap between business and technology - Behaviour Driven Developme...
Bridging the gap between business and technology - Behaviour Driven Developme...
 
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)
Verifying Drupal modules with OWASP ASVS 2014 (European Drupal Days 2015)
 
Drupal for Big Data - is it ready? (European Drupal Days 2015)
Drupal for Big Data - is it ready? (European Drupal Days 2015)Drupal for Big Data - is it ready? (European Drupal Days 2015)
Drupal for Big Data - is it ready? (European Drupal Days 2015)
 
Web automation with #d8rules (European Drupal Days 2015)
Web automation with #d8rules (European Drupal Days 2015)Web automation with #d8rules (European Drupal Days 2015)
Web automation with #d8rules (European Drupal Days 2015)
 
Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)Drupal Continuous Integration (European Drupal Days 2015)
Drupal Continuous Integration (European Drupal Days 2015)
 
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)UN World Food Programme Standards & Best Practises (European Drupal Days 2015)
UN World Food Programme Standards & Best Practises (European Drupal Days 2015)
 
A Practical Introduction to Symfony (European Drupal Days 2015)
A Practical Introduction to Symfony (European Drupal Days 2015)A Practical Introduction to Symfony (European Drupal Days 2015)
A Practical Introduction to Symfony (European Drupal Days 2015)
 

Similaire à Drupal theming - a practical approach (European Drupal Days 2015)

Drupal Theming for Developers
Drupal Theming for DevelopersDrupal Theming for Developers
Drupal Theming for DevelopersIan Carnaghan
 
Drupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 versionDrupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 versionDavid Lanier
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend developmentsparkfabrik
 
Twig in the wild august 2018 drupal govcon draft
Twig in the wild   august 2018 drupal govcon draftTwig in the wild   august 2018 drupal govcon draft
Twig in the wild august 2018 drupal govcon draftJeremyKoulish
 
Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an OverviewMatt Weaver
 
Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal8 themingdeepdive drupaldevdays-montpellier17042015Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal8 themingdeepdive drupaldevdays-montpellier17042015Romain Jarraud
 
Theming moodle technical
Theming moodle   technicalTheming moodle   technical
Theming moodle technicalAlex Walker
 
Theming tips and tricks
Theming tips and tricksTheming tips and tricks
Theming tips and tricksaaroncouch
 
Ready. Set. Drupal! An Intro to Drupal 8, Part 2
Ready. Set. Drupal! An Intro to Drupal 8, Part 2Ready. Set. Drupal! An Intro to Drupal 8, Part 2
Ready. Set. Drupal! An Intro to Drupal 8, Part 2Acquia
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To DrupalLauren Roth
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsLuís Carneiro
 
Upgrading to Drupal 7
Upgrading to Drupal 7Upgrading to Drupal 7
Upgrading to Drupal 7DesignHammer
 
Adopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal wayAdopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal wayMarek Sotak
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Drupalcon Paris
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Ben Shell
 

Similaire à Drupal theming - a practical approach (European Drupal Days 2015) (20)

Drupal Theming for Developers
Drupal Theming for DevelopersDrupal Theming for Developers
Drupal Theming for Developers
 
Drupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 versionDrupal upgrades and migrations. BAD Camp 2013 version
Drupal upgrades and migrations. BAD Camp 2013 version
 
Drupal 8: frontend development
Drupal 8: frontend developmentDrupal 8: frontend development
Drupal 8: frontend development
 
Twig in the wild august 2018 drupal govcon draft
Twig in the wild   august 2018 drupal govcon draftTwig in the wild   august 2018 drupal govcon draft
Twig in the wild august 2018 drupal govcon draft
 
Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an Overview
 
Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal8 themingdeepdive drupaldevdays-montpellier17042015Drupal8 themingdeepdive drupaldevdays-montpellier17042015
Drupal8 themingdeepdive drupaldevdays-montpellier17042015
 
Introduction to Wordpress
Introduction to WordpressIntroduction to Wordpress
Introduction to Wordpress
 
Theming moodle technical
Theming moodle   technicalTheming moodle   technical
Theming moodle technical
 
Theming tips and tricks
Theming tips and tricksTheming tips and tricks
Theming tips and tricks
 
Ready. Set. Drupal! An Intro to Drupal 8, Part 2
Ready. Set. Drupal! An Intro to Drupal 8, Part 2Ready. Set. Drupal! An Intro to Drupal 8, Part 2
Ready. Set. Drupal! An Intro to Drupal 8, Part 2
 
Introduction To Drupal
Introduction To DrupalIntroduction To Drupal
Introduction To Drupal
 
Drupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First StepsDrupal Camp Porto - Developing with Drupal: First Steps
Drupal Camp Porto - Developing with Drupal: First Steps
 
Forensic Theming for Drupal
Forensic Theming for DrupalForensic Theming for Drupal
Forensic Theming for Drupal
 
Upgrading to Drupal 7
Upgrading to Drupal 7Upgrading to Drupal 7
Upgrading to Drupal 7
 
Drupal theming
Drupal themingDrupal theming
Drupal theming
 
Efficient theming in Drupal
Efficient theming in DrupalEfficient theming in Drupal
Efficient theming in Drupal
 
Adopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal wayAdopt or hack - how to hack a theme in a Drupal way
Adopt or hack - how to hack a theme in a Drupal way
 
Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3Staging Drupal 8 31 09 1 3
Staging Drupal 8 31 09 1 3
 
D7 as D8
D7 as D8D7 as D8
D7 as D8
 
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...Building a Drupal Distribution using Features, Drush Make, Installation Profi...
Building a Drupal Distribution using Features, Drush Make, Installation Profi...
 

Plus de Eugenio Minardi

Delphi and ExtJS (26 ottobre 2017)
Delphi and ExtJS (26 ottobre 2017)Delphi and ExtJS (26 ottobre 2017)
Delphi and ExtJS (26 ottobre 2017)Eugenio Minardi
 
ExtJS: La piattaforma vincente (tools)
ExtJS: La piattaforma vincente (tools)ExtJS: La piattaforma vincente (tools)
ExtJS: La piattaforma vincente (tools)Eugenio Minardi
 
ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)Eugenio Minardi
 
ExtJS: La piattaforma vincente (rich UI)
ExtJS: La piattaforma vincente (rich UI)ExtJS: La piattaforma vincente (rich UI)
ExtJS: La piattaforma vincente (rich UI)Eugenio Minardi
 
ExtJS: La piattaforma vincente (class system)
ExtJS: La piattaforma vincente (class system)ExtJS: La piattaforma vincente (class system)
ExtJS: La piattaforma vincente (class system)Eugenio Minardi
 
ExtJS: La piattaforma vincente
ExtJS: La piattaforma vincenteExtJS: La piattaforma vincente
ExtJS: La piattaforma vincenteEugenio Minardi
 
Distributed Team Management: 
Pitfall, Challenges and Advantages
Distributed Team Management: 
Pitfall, Challenges and AdvantagesDistributed Team Management: 
Pitfall, Challenges and Advantages
Distributed Team Management: 
Pitfall, Challenges and AdvantagesEugenio Minardi
 
Another Copernican Revolution: maintenance first, projects second (European D...
Another Copernican Revolution: maintenance first, projects second (European D...Another Copernican Revolution: maintenance first, projects second (European D...
Another Copernican Revolution: maintenance first, projects second (European D...Eugenio Minardi
 
MongoDB: What, why, when
MongoDB: What, why, whenMongoDB: What, why, when
MongoDB: What, why, whenEugenio Minardi
 
Il Web orientato al futuro: Express, Angular e nodeJS
Il Web orientato al futuro: Express, Angular e nodeJS Il Web orientato al futuro: Express, Angular e nodeJS
Il Web orientato al futuro: Express, Angular e nodeJS Eugenio Minardi
 
MEAN: il nuovo stack di sviluppo per il futuro del web
MEAN: il nuovo stack di sviluppo per il futuro del webMEAN: il nuovo stack di sviluppo per il futuro del web
MEAN: il nuovo stack di sviluppo per il futuro del webEugenio Minardi
 
Gestione della configurazione in Drupal 8
Gestione della configurazione in Drupal 8Gestione della configurazione in Drupal 8
Gestione della configurazione in Drupal 8Eugenio Minardi
 
Labortatorio di Information Design e UX con Drupal
Labortatorio di Information Design e UX con DrupalLabortatorio di Information Design e UX con Drupal
Labortatorio di Information Design e UX con DrupalEugenio Minardi
 
Drupal dashboard for dummies with d3
Drupal dashboard for dummies with d3Drupal dashboard for dummies with d3
Drupal dashboard for dummies with d3Eugenio Minardi
 

Plus de Eugenio Minardi (14)

Delphi and ExtJS (26 ottobre 2017)
Delphi and ExtJS (26 ottobre 2017)Delphi and ExtJS (26 ottobre 2017)
Delphi and ExtJS (26 ottobre 2017)
 
ExtJS: La piattaforma vincente (tools)
ExtJS: La piattaforma vincente (tools)ExtJS: La piattaforma vincente (tools)
ExtJS: La piattaforma vincente (tools)
 
ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)ExtJS: La piattaforma vincente (multiple screens)
ExtJS: La piattaforma vincente (multiple screens)
 
ExtJS: La piattaforma vincente (rich UI)
ExtJS: La piattaforma vincente (rich UI)ExtJS: La piattaforma vincente (rich UI)
ExtJS: La piattaforma vincente (rich UI)
 
ExtJS: La piattaforma vincente (class system)
ExtJS: La piattaforma vincente (class system)ExtJS: La piattaforma vincente (class system)
ExtJS: La piattaforma vincente (class system)
 
ExtJS: La piattaforma vincente
ExtJS: La piattaforma vincenteExtJS: La piattaforma vincente
ExtJS: La piattaforma vincente
 
Distributed Team Management: 
Pitfall, Challenges and Advantages
Distributed Team Management: 
Pitfall, Challenges and AdvantagesDistributed Team Management: 
Pitfall, Challenges and Advantages
Distributed Team Management: 
Pitfall, Challenges and Advantages
 
Another Copernican Revolution: maintenance first, projects second (European D...
Another Copernican Revolution: maintenance first, projects second (European D...Another Copernican Revolution: maintenance first, projects second (European D...
Another Copernican Revolution: maintenance first, projects second (European D...
 
MongoDB: What, why, when
MongoDB: What, why, whenMongoDB: What, why, when
MongoDB: What, why, when
 
Il Web orientato al futuro: Express, Angular e nodeJS
Il Web orientato al futuro: Express, Angular e nodeJS Il Web orientato al futuro: Express, Angular e nodeJS
Il Web orientato al futuro: Express, Angular e nodeJS
 
MEAN: il nuovo stack di sviluppo per il futuro del web
MEAN: il nuovo stack di sviluppo per il futuro del webMEAN: il nuovo stack di sviluppo per il futuro del web
MEAN: il nuovo stack di sviluppo per il futuro del web
 
Gestione della configurazione in Drupal 8
Gestione della configurazione in Drupal 8Gestione della configurazione in Drupal 8
Gestione della configurazione in Drupal 8
 
Labortatorio di Information Design e UX con Drupal
Labortatorio di Information Design e UX con DrupalLabortatorio di Information Design e UX con Drupal
Labortatorio di Information Design e UX con Drupal
 
Drupal dashboard for dummies with d3
Drupal dashboard for dummies with d3Drupal dashboard for dummies with d3
Drupal dashboard for dummies with d3
 

Dernier

VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Standkumarajju5765
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Servicesexy call girls service in goa
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girlsstephieert
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girladitipandeya
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsThierry TROUIN ☁
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Delhi Call girls
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersDamian Radcliffe
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)Damian Radcliffe
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkataanamikaraghav4
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Roomishabajaj13
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Roomgirls4nights
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirtrahman018755
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024APNIC
 

Dernier (20)

VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls KolkataVIP Call Girls Kolkata Ananya 🤌  8250192130 🚀 Vip Call Girls Kolkata
VIP Call Girls Kolkata Ananya 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night StandHot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
Hot Call Girls |Delhi |Hauz Khas ☎ 9711199171 Book Your One night Stand
 
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 26 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine ServiceHot Service (+9316020077 ) Goa  Call Girls Real Photos and Genuine Service
Hot Service (+9316020077 ) Goa Call Girls Real Photos and Genuine Service
 
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Model Towh Delhi 💯Call Us 🔝8264348440🔝
 
Russian Call girls in Dubai +971563133746 Dubai Call girls
Russian  Call girls in Dubai +971563133746 Dubai  Call girlsRussian  Call girls in Dubai +971563133746 Dubai  Call girls
Russian Call girls in Dubai +971563133746 Dubai Call girls
 
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call GirlVIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
VIP 7001035870 Find & Meet Hyderabad Call Girls LB Nagar high-profile Call Girl
 
AlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with FlowsAlbaniaDreamin24 - How to easily use an API with Flows
AlbaniaDreamin24 - How to easily use an API with Flows
 
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls KolkataRussian Call Girls in Kolkata Ishita 🤌  8250192130 🚀 Vip Call Girls Kolkata
Russian Call Girls in Kolkata Ishita 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
Best VIP Call Girls Noida Sector 75 Call Me: 8448380779
 
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No AdvanceRohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
Rohini Sector 26 Call Girls Delhi 9999965857 @Sabina Saikh No Advance
 
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providersMoving Beyond Twitter/X and Facebook - Social Media for local news providers
Moving Beyond Twitter/X and Facebook - Social Media for local news providers
 
How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)How is AI changing journalism? (v. April 2024)
How is AI changing journalism? (v. April 2024)
 
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls KolkataLow Rate Call Girls Kolkata Avani 🤌  8250192130 🚀 Vip Call Girls Kolkata
Low Rate Call Girls Kolkata Avani 🤌 8250192130 🚀 Vip Call Girls Kolkata
 
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With RoomVIP Kolkata Call Girl Salt Lake 👉 8250192130  Available With Room
VIP Kolkata Call Girl Salt Lake 👉 8250192130 Available With Room
 
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICECall Girls In South Ex 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
Call Girls In South Ex 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SERVICE
 
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
Call Girls In Sukhdev Vihar Delhi 💯Call Us 🔝8264348440🔝
 
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With RoomVIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
VIP Kolkata Call Girls Salt Lake 8250192130 Available With Room
 
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya ShirtChallengers I Told Ya Shirt
Challengers I Told Ya ShirtChallengers I Told Ya Shirt
 
On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024On Starlink, presented by Geoff Huston at NZNOG 2024
On Starlink, presented by Geoff Huston at NZNOG 2024
 

Drupal theming - a practical approach (European Drupal Days 2015)

  • 1. Subtitel 1 © Ibuildings 2014/2015 - All rights reserved #DrupalDaysEU DRUPAL THEMING - a practical approach by Chris Jansen
  • 2. #DrupalDaysEU © Ibuildings 2014/2015 - All rights reserved Gold Sponsors
  • 3. #DrupalDaysEU © Ibuildings 2014/2015 - All rights reserved Media Sponsors Silver Sponsors
  • 4. A practical approach to the basics Chris Jansen 20 march 2015, Milan Drupal theming
  • 7. Topics Tools and materials Introducing basic concepts Design breakdown Creating the theme Common mistakes 7
  • 10. Install virtualbox and vagrant http://www.vagrantup.com/downloads https://www.virtualbox.org/wiki/Downloads 10 Copy image Supplied on several USB sticks Boot VM vagrant up
  • 11. Access drupal site 192.168.33.10 user: admin pass: admin 11 Access server vagrant ssh Docroot on server /vagrant/public/ == /var/www/public
  • 13. Introducing basic concepts • Directory layout • Basic theme elements • Entities & view modes • Render arrays • Hooks • Render process • Overriding theme functions • Overriding templates 13
  • 14. Directory layout 14 drupal.org/project/* Custom and/or sandbox modules. Modules created by the features module. Custom and/or contributed themes. Best practice
  • 15. Basic theme elements • Regions • Blocks • Logo • Site name & slogan • Main/Secondary menu 15
  • 16. Entities & view modes Entities are stored information (usually content) • Nodes • Taxonomy terms • Users • etc. 16
  • 17. Entities & view modes View modes are different ways to display entities • Node • Full (Default view mode) • Teaser (configurable by default) • Rss • Taxonomy • Taxonomy term page (Default view mode) • User • User account (Default view mode) • etc. 17 Uitwerken
  • 18. Adding your own view modes Create a custom module • Implement hook_entity_info_alter() Use contrib module: • Entity View Mode • https://www.drupal.org/project/entity_view_mode • Display suite • https://www.drupal.org/project/ds 18
  • 19. Keyed array of data • #Propery or #value • Child Render arrays - WHAT? 19
  • 20. render() theme_container() drupal_attributes() render() Render arrays - HOW? Properties • What to render • How to render it Children • What to include within 20
  • 21. Properties • What to render • How to render it render() theme_item_list() drupal_attributes() drupal_process_attached() Render arrays - HOW? 21
  • 22. Render arrays - HOW? Properties • What to render • How to render it 22 render()
  • 23. Render arrays - WHY? Data can be changed, markup can not. • Change positioning • Add/Change/Remove values 23
  • 24. Render arrays - WHY? Data can be changed, markup can not. • Change positioning • Add/Change/Remove values 24
  • 25. Hooks hook_* • Modules only hook_*_alter • Modules • Themes template_* • Modules • Themes theme_* • Themes 25 Module Base theme Subtheme Current theme
  • 26. Theme function • Fast • Limited (pre)processing • theme_*() Template • Flexible • *.tpl.php Render process theme() 26 render aray theme function template HTML process
 template_process_* preprocess
 template_preprocess_*
  • 27. Overriding theme functions Overrides live in template.php Copy & rename original theme function • theme_item_list -> themename_item_list Alter the function to suit your needs. Clear cache 27
  • 28. Overriding templates Copy template file to your theme folder • modules/block/block.tpl.php -> sites/all/ themes/yourtheme/templates/block.tpl.php Alter the template Clear cache 28 Best practice: Place your templates in a template folder e.g.: ../yourtheme/templates/block.tpl.php
  • 30. Design breakdown Identify regions Determine additional requirements 30
  • 31. Identify regions Top bar Main menu Left sidebar Main content Footer 31
  • 32. Identify regions Top bar Main menu Sidebar Left & Right Main content Footer 32
  • 33. Identify regions Top bar Main menu Sidebar Left & Right Main content Split footer Left & Right Footer 33
  • 34. Identify regions Top bar Main menu Sidebar Left & Right Main content Below content Left & Right Footer 34
  • 35. Determine additional requirements Browser support Slideshows Fancy menu’s etc. 35
  • 37. Where to start Buy a theme Start from scratch Subtheme • Start from scratch • Starterkit 37
  • 38. Creating the theme Creating the .info file • Theme from scratch • Subtheme from scratch • Define regions • Define CSS/JS ‣ Override/disable CSS/JS Other ways to add CSS/JS Alter markup using templates 38
  • 39. Theme from scratch Required keys • name • core Recommended keys • description Commonly used optional keys • base theme • stylesheets • scripts 39
  • 40. Subtheme from scratch Required keys • name • core Recommended keys • description Commonly used optional keys • base theme • stylesheets • scripts 40
  • 41. Exercises 41 1. Create a new theme 2. Change your theme to be a Zen subtheme 3. Compare your subtheme to Zen, what do you notice?
  • 42. Subtheme compared to Zen Different regions • Unless defined otherwise Drupal assumes default regions: Header, Highlighted, Help, Content, Left sidebar, Right sidebar, Footer No stylesheets • All stylesheets defined in basetheme.info are inherited, but only if at least one stylesheet has been defined in mytheme.info • Zen conditionally defines stylesheets in hook_preprocess_html No Logo 42
  • 43. Add region to .info file Clear caches Print the region in page.tpl.php Define regions 43 Best practice: Place your templates in a template folder e.g.: ../yourtheme/templates/block.tpl.php
  • 44. Exercises 44 1. Add zen’s regions to your info file 2. Add a custom region to your info file 3. Render the region in page.tpl.php Hints: • Copy zen’s page.tpl.php • git checkout ex-1 for previous exercise results
  • 45. Define CSS/JS Add CSS/JS to info file Clear Caches 45
  • 46. Other ways to add CSS/JS Functions to use • using drupal_add_css() • using drupal_add_js() • using [‘#attached’] in a render array() Where to use them • hook_preprocess_HOOK() • hook_process_HOOK() • hook_TYPE_alter() 46
  • 48. Other ways to add CSS/JS Adding options to your JS 48
  • 49. Other ways to add CSS/JS Add/Override/Remove directly • hook_js_alter(); • hook_css_alter(); 49
  • 50. Exercise 50 Experiment 1. Define CSS in info file 2. Remove/override CSS in info file 3. Add css using drupal_add_css() 4. Add a “hello world” script using drupal_add_js() 5. Add css using [‘#attached’] 6. Add a “hello world” script using [‘#attached’] 7. Place a script in the footer. Hints: • git checkout ex-2 for previous exercise results
  • 51. Alter markup using templates Lets create a two-column article. Copy template file to your theme folder sites/all/themes/zen/templates/node.tpl.php -> sites/all/themes/yourtheme/templates/node.tpl.php Alter the template Clear cache 51
  • 52. Alter markup using templates 52
  • 53. Alter markup using templates Problem! • Template is used for all content types Solution: suggestions • node.tpl.php • node--type.tpl.php • node--type--view_mode.tpl.php (EVM) • node--nodeid.tpl.php • node--nodeid--view_mode.tpl.php (EVM) 53
  • 54. Display the author on an article page. • Render user with view mode teaser • Use preprocessing • Use a template Exercise 54 Hints: • user_load() • user_view() • $variables[‘theme_hook_suggestions’] • git checkout ex-3 for previous exercise results Author name Article title Article text Article text Article text Article text Article text Article text Article text Article text Article text Article text Article text Article text Article text Article text Article text
  • 56. Hacking core, modules or themes Why not? • Breaks upgrades • Maintainability • theme_* Alternatives • template_(pre)process_* • hook_*_alter hooks • theme_* 56
  • 57. Advanced logic in templates Why not? • Templates are responsible for display only • Difficult to get to variables • Hard to maintain Alternatives • (pre)process data before it reaches the template Only PHP you should use • if(content_present) • foreach($content_list as $content) • print ($content); 57
  • 58. Changing field ordering in templates Why not? • Hard to maintain Alternatives • Use view modes 58
  • 59. Using global $user Why not? • Security! Alternatives • Use user_uid_optional_load() 59
  • 60. Not using check_plain()/check_markup() Why is this a problem? • Security! When to use them? • Check_plain() • Check_markup() 60