1
DEMYSTIFYING DRUPAL 7
THEMING
AND FRONT END DEVELOPMENT WITH DRUPAL
Presented by /
Company /
A web, mobile, Drupal design and development services provider based in Lagos, Nigeria,
Phone: 081 7608 4053 Email: info@icelark.com
Tony N. Ogbonna (CEO/Developer Icelark Projects) @togbonna
Icelark Projects (www.icelark.com) @icelarkProjects
2
INTRODUCTION
This is a session on the basics of Drupal 7 themeing and front-end customization
of a Drupal 7 website.
This training session is targeted as intermediate to advanced Drupal user. (Sharp
beginners might also benefit)
The objectives of this session are two fold:
First is to impress on you a fundamental knowledge of the Drupal theme system
and an understanding of how it works.
Second is to empower you with a knowledge of how you might start to use the
power and flexibility of the Drupal theme system to easily customize the look and
feel of a Drupal website.
3
WHAT IS THEMING?
Simply, it is the act of changing the appearance/look and feel of a Drupal website
to suite your taste, requirements or style.
Theming is made up of different pieces:
1. Designing the appearance of your website: Photoshop, Fireworks, wireframes,
pen and papers, etc
2. Creating the HTML to contro the layout of your website
3. Changing the HTML output of Drupal to fit your design. ie Modifying the HTML
outputed by Drupal to conform to the HTML you need (The haredst part)
4. Much more...
4
OUR ASSUMPTIONS...
Basic knowledge of HTML, CSS and PHP
5 . 1
BASICS OF DRUPAL 7 THEMING
The "Drupal Theme Layer" and the theme that uses it are responsible for the look
and feel of a Drupal website.
A good theme consists of all the same elements that you would find on any
respectable website.
This includes standards-compliant HTML markup, CSS, Javascripts, images and
all other components that make the user interface.
How all of these elements are put together into a Drupal website is what makes
the Drupal so flexible and powerful.
5 . 2
BASICS OF DRUPAL 7 THEMING...
A Drupal theme can be as simple or as complex as you want it to be.
A Drupal theme has the ultimate control over every aspect of each page of a
website.
So, like Drupal itself, themes are flexible and powerful.
But for you to be able to take full advantage of all that power and flexibility you
have to be able to understand how a theme works under the hood.
5 . 3
THE DRUPAL CORE THEMES
The core theme directory.
The core themes: Batik, Garland, Seven, Stark
Theme Engines.
5 . 4
DRUPAL THEME ADMINISTRATION
Enabling and setting as default
Adminstration theme
Global theme setting
Installing a new theme
6
HOW THE DRUPAL THEME SYSTEM WORKS
1. OVERVIEW OF THE THEME STRUCTURES AND THEME FILES
7 . 1
7 . 2
1. OVERVIEW OF THE THEME STRUCTURES AND THEME FILES
.info file (Required)
template files (.tpl.php files)
Resource files: CSS, Javascripts, images, logo, screenshot
7 . 3
1. OVERVIEW OF THE THEME STRUCTURES AND THEME FILES
template files (.tpl.php files)
are used for the HTML markup and PHP variables
Each .tpl.php file handles the output of a specific themable chunk of data
This makes it fairly easy for those with little or no PHP experience to make
changes to HTML code.
They are optional, and if none exists in your theme it will fall back to the default
output
1. OVERVIEW OF THE THEME STRUCTURES AND THEME FILES
template files (.tpl.php files)
7 . 47 . 5
1. OVERVIEW OF THE THEME STRUCTURES AND THEME FILES
template.php file
are used for the HTML markup and PHP variables
Each .tpl.php file handles the output of a specific themable chunk of data
They are optional, and if none exists in your theme it will fall back to the default
output
7 . 6
1. OVERVIEW OF THE THEME STRUCTURES AND THEME FILES
Resource files: CSS, Javascripts, images, logo, screenshot
8 . 1
2. TEMPLATE FILES HIERARCHY
9 . 1
3. ANATOMY OF THE .INFO FILE
The .info file is a static text file for defining and configuring a theme
Each line in the .info file is a key-value pair
10 . 1
4. REGIONS
Most of the content found on Drupal pages is output inside a region
Typical regions include the header, footer, sidebars, and content
these regions often play a large part in defining the high-level structure of your
HTML markup
An option appears in the blocks interface at admin/structure/block for each
region, allowing site administrators to control and position the blocks inside them
4. REGIONS
10 . 2
4. REGIONS
10 . 311 . 1
5. THEME SETTINGS AND HOW THEY ARE USED
Various page elements output by the theme can be toggled on and off on the
theme's configuration page
12 . 1
6. THEME CACHE
13 . 1
7. CREATING A SUB-THEME
Sub-themes are just like any other theme, with one difference: They inherit the
parent theme's resources
Style sheet inheritance: All style sheets defined in the parent theme will be
inherited.
JavaScript inheritance: All JavaScripts defined in the parent theme will be
inherited.
To set Toggle Display of Theme: Overriding or adding features: Specify a new
feature in sub-theme's .info file.
Template.php function inheritance: Anything defined in the parent theme's
template.php file will be inherited.
13 . 2
7. CREATING A SUB-THEME
Page, node, block and other template (.tpl.php) file inheritance: Any .tpl.php files
from the parent theme will be inherited.
Screen shots, logo and favicon inheritance: The parent theme's screen shot will be
inherited. The parent theme's logo (logo.png/logo.jpg) will not be inherited. The
parent theme's favicon (favicon.ico) will not be inherited.
Region inheritance: Sub-themes do not inherit custom regions from a parent
theme,If you are using custom regions, you should copy the region declarations
from the parent theme's .info file
14
ADVANCED THEMING (FURTHER EXPLORATION)
Theme layer variables
Preprocess and process functions
Render API
Theming forms
Managing CSS files
Working with base and sub themes
Sustainability and best practices (SASS techniques and tools).
15
-
THE END
- |
-
www.drupal.org www.drupal.com
www.DrupalNigeia org
- A Presentation of Icelark Projects
- www.icelark.com
@icelarkProjects

Demystifying drupal 7 theming

  • 1.
    1 DEMYSTIFYING DRUPAL 7 THEMING ANDFRONT END DEVELOPMENT WITH DRUPAL Presented by / Company / A web, mobile, Drupal design and development services provider based in Lagos, Nigeria, Phone: 081 7608 4053 Email: info@icelark.com Tony N. Ogbonna (CEO/Developer Icelark Projects) @togbonna Icelark Projects (www.icelark.com) @icelarkProjects
  • 2.
    2 INTRODUCTION This is asession on the basics of Drupal 7 themeing and front-end customization of a Drupal 7 website. This training session is targeted as intermediate to advanced Drupal user. (Sharp beginners might also benefit) The objectives of this session are two fold: First is to impress on you a fundamental knowledge of the Drupal theme system and an understanding of how it works. Second is to empower you with a knowledge of how you might start to use the power and flexibility of the Drupal theme system to easily customize the look and feel of a Drupal website.
  • 3.
    3 WHAT IS THEMING? Simply,it is the act of changing the appearance/look and feel of a Drupal website to suite your taste, requirements or style. Theming is made up of different pieces: 1. Designing the appearance of your website: Photoshop, Fireworks, wireframes, pen and papers, etc 2. Creating the HTML to contro the layout of your website 3. Changing the HTML output of Drupal to fit your design. ie Modifying the HTML outputed by Drupal to conform to the HTML you need (The haredst part) 4. Much more...
  • 4.
  • 5.
    5 . 1 BASICSOF DRUPAL 7 THEMING The "Drupal Theme Layer" and the theme that uses it are responsible for the look and feel of a Drupal website. A good theme consists of all the same elements that you would find on any respectable website. This includes standards-compliant HTML markup, CSS, Javascripts, images and all other components that make the user interface. How all of these elements are put together into a Drupal website is what makes the Drupal so flexible and powerful.
  • 6.
    5 . 2 BASICSOF DRUPAL 7 THEMING... A Drupal theme can be as simple or as complex as you want it to be. A Drupal theme has the ultimate control over every aspect of each page of a website. So, like Drupal itself, themes are flexible and powerful. But for you to be able to take full advantage of all that power and flexibility you have to be able to understand how a theme works under the hood.
  • 7.
    5 . 3 THEDRUPAL CORE THEMES The core theme directory. The core themes: Batik, Garland, Seven, Stark Theme Engines.
  • 8.
    5 . 4 DRUPALTHEME ADMINISTRATION Enabling and setting as default Adminstration theme Global theme setting Installing a new theme
  • 9.
    6 HOW THE DRUPALTHEME SYSTEM WORKS
  • 10.
    1. OVERVIEW OFTHE THEME STRUCTURES AND THEME FILES
  • 11.
  • 12.
    7 . 2 1.OVERVIEW OF THE THEME STRUCTURES AND THEME FILES .info file (Required) template files (.tpl.php files) Resource files: CSS, Javascripts, images, logo, screenshot
  • 13.
    7 . 3 1.OVERVIEW OF THE THEME STRUCTURES AND THEME FILES template files (.tpl.php files) are used for the HTML markup and PHP variables Each .tpl.php file handles the output of a specific themable chunk of data This makes it fairly easy for those with little or no PHP experience to make changes to HTML code. They are optional, and if none exists in your theme it will fall back to the default output
  • 14.
    1. OVERVIEW OFTHE THEME STRUCTURES AND THEME FILES template files (.tpl.php files)
  • 16.
    7 . 47. 5 1. OVERVIEW OF THE THEME STRUCTURES AND THEME FILES template.php file are used for the HTML markup and PHP variables Each .tpl.php file handles the output of a specific themable chunk of data They are optional, and if none exists in your theme it will fall back to the default output
  • 17.
    7 . 6 1.OVERVIEW OF THE THEME STRUCTURES AND THEME FILES Resource files: CSS, Javascripts, images, logo, screenshot
  • 18.
    8 . 1 2.TEMPLATE FILES HIERARCHY
  • 19.
    9 . 1 3.ANATOMY OF THE .INFO FILE The .info file is a static text file for defining and configuring a theme Each line in the .info file is a key-value pair
  • 20.
    10 . 1 4.REGIONS Most of the content found on Drupal pages is output inside a region Typical regions include the header, footer, sidebars, and content these regions often play a large part in defining the high-level structure of your HTML markup An option appears in the blocks interface at admin/structure/block for each region, allowing site administrators to control and position the blocks inside them
  • 21.
  • 22.
  • 23.
  • 25.
    10 . 311. 1 5. THEME SETTINGS AND HOW THEY ARE USED Various page elements output by the theme can be toggled on and off on the theme's configuration page
  • 26.
    12 . 1 6.THEME CACHE
  • 27.
    13 . 1 7.CREATING A SUB-THEME Sub-themes are just like any other theme, with one difference: They inherit the parent theme's resources Style sheet inheritance: All style sheets defined in the parent theme will be inherited. JavaScript inheritance: All JavaScripts defined in the parent theme will be inherited. To set Toggle Display of Theme: Overriding or adding features: Specify a new feature in sub-theme's .info file. Template.php function inheritance: Anything defined in the parent theme's template.php file will be inherited.
  • 28.
    13 . 2 7.CREATING A SUB-THEME Page, node, block and other template (.tpl.php) file inheritance: Any .tpl.php files from the parent theme will be inherited. Screen shots, logo and favicon inheritance: The parent theme's screen shot will be inherited. The parent theme's logo (logo.png/logo.jpg) will not be inherited. The parent theme's favicon (favicon.ico) will not be inherited. Region inheritance: Sub-themes do not inherit custom regions from a parent theme,If you are using custom regions, you should copy the region declarations from the parent theme's .info file
  • 29.
    14 ADVANCED THEMING (FURTHEREXPLORATION) Theme layer variables Preprocess and process functions Render API Theming forms Managing CSS files Working with base and sub themes Sustainability and best practices (SASS techniques and tools).
  • 30.
    15 - THE END - | - www.drupal.orgwww.drupal.com www.DrupalNigeia org - A Presentation of Icelark Projects - www.icelark.com @icelarkProjects