SlideShare a Scribd company logo
Top 20 mistakes you will make on your 1st Drupal project
WHO IS THIS GUY?
• @iztok
www.twitter.com/iztok
• Drupal site builder, themer
and developer
• Passion about UX and design
• Drupal consultant
www.iztoksmolic.com
• Manager at Agile Drop
www.agiledrop.com
• Drupal Slovenia Association
organizing meetups in Ljubljana
THE COMMON WRONG DISPOSITIONS
• I know MySQL/PHP, I know Drupal
• There is a module for anything like in Joomla/Wordpress
• Drupal has a long and steep learning curve
After 5 years I am here.
Top 20 mistakes you will make on your 1st Drupal project
1. NOT KNOWING THE FURNITURE
Designer must be
aware of the
common elements.
Check this blog post
from Chapter Three
2. OVER-DESIGNING FORMS
• HTML markup is predefined for form
• altering markup requires development skills
Solution
• Style forms: http://drupal.org/project/uniform
• Group
fields: http://drupal.org/project/field_group
• Add element (and wrappers) with
hook_form_alter
3. BAD CONTENT ARCHITECTURE DECISIONS
• using too much content types
(e.g. is Article really so different from Public release? Maybe
we can use category to separate them)
• not using node types
(e.g. instead of listing staff as a table in the Page body,
maybe build the page with Views and content type Staff
member)
No real formula, just practice and experiences.
Top 20 mistakes you will make on your 1st Drupal project
4. WRONG FOLDER STRUCTURE
If using single site installation (one Drupal core, one
website) put:
• themes in /sites/default/themes
• modules from drupal.org in /sites/default/modules/contrib
• custom modules in /sites/default/modules/custom
Do not put themes and modules in the folder on the root
level.
Never. You can use all folder instead of default – your call.
More about this: http://drupal.org/node/120641
5. CHOOSING UNSUPPORTED MODULE
• Check the usage/download counter, last update, open
issues counter, all that can give a idea about the module
status.
• Read the description, in many cases authors let the
people know that module will be deprecated in favor of
some other more comprehensive module.
6. ORPHANED MODULES
• Clean your environment, or even better, test modules on
other installations!
• Leaving old, unused modules can confuse you latter on,
not to mention other developers.
7. USING DEFAULT BLOCKS SYSTEM
Use default blocks system
only if project is very very
simple.
A couple of attempts were
made to improve block
system, I bet on the
following two:
• Context, which is block
system on steroids
• Panels, introduces new
block-like concept
8. PUTTING CONTENT/CODE IN BLOCKS
Default blocks allow user generated content, but you can't set permissions
for editing different blocks
• Bean, you can add fields to different blocks types, which have separate
permissions (like content types do)
• Boxes, blocks with a unique machine names
Top 20 mistakes you will make on your 1st Drupal project
9. HACKING CORE/CONTRIB THEME
if you decided to use a theme from core or from drupal.org,
there is no need to go and edit its code. Make a sub-
theme
• more about creating sub-
theme: http://drupal.org/node/225125
10. USING PAGE TEMPLATES FOR EACH SUB PAGE
Try to omit page--xxx-tpl.php templates. It duplicates the
code, and makes maintenance difficult.
Try using Context Layout or Panels if variations are really
needed.
Panels have dragable user
interface system and a
layout generator tool.
No code needed!
11. LOGIC IN TEMPLATES
SQL queries and calculations don't belong to the template
layer. If logic is not so advance it can be placed in the
preprocess function in template.php file.
• About process &
preprocess: http://drupal.org/node/223430
12. USING TOO COMMON CSS TARGETING
Drupal outputs a LOT of markup with specific HTML classes
and ids. Knowing which class is appropriate to target is
the key.
• Ids are usually unique identifiers for blocks/nodes/views
• views have classes with view name and display name
seperated. Don’t target displays (e.g. .views-display-id-
block)
• .items-list, .content, .view-content etc. are used all over
your Drupal site, don’t use for specific targeting.
13. NOT USING THE BASIC DRUPAL FUNCTIONS
Drupal comes with some very handy functions, we should
use them
- l() and url() - in contrast of hardcoded relative URL address
can outputs aliased URL path
- base_path(), returns base URL of the Drupal installation
- theme() functions like theme('image_style',array()) to out
put styled image
Top 20 mistakes you will make on your 1st Drupal project
14. CODING
There is a 80% possibility that what you want to build can be
build with a combination of modules.
Usual suspects:
• Views (your UI for SQL queries)
• views_field_view, views_bulk_operations
• Rules (executing commands on events)
• Panels (overriding default paths like node/%nid)
• Filed collection (join fields into one field)
15. HACKING CORE AND CONTRIB MODULES
Fixing code directly in the module files makes the website
impossible to update. Instead Drupal provides hooks and
preprocess functions.
• More about hooks:
http://api.drupal.org/api/drupal/includes!module.inc/group
/hooks/7
16. NOT USING API FUNCTIONS
• Database API, dynamic queries:
http://drupal.org/node/310075
• Entity query API: http://drupal.org/node/1343708
Bets to learn from examples:
http://drupal.org/project/examples
17. NOT KNOWING HOW TO DEBUG
When you would usually use print_r() to get the content of a array
or object to your browser, Drupal has Devel
(http://drupal.org/project/devel):
• dpm($variable) – prints content of variable in human friendly
way
You can also store info to a log: http://drupal.org/project/object_log
Can’t find the right template?
Use Devel Themer (http://drupal.org/project/devel_themer)
18. NOT RESPECTING THE CODING STANDARDS
Different approaches and coding styles make code less
organized and makes the job for other developers mode
difficult.
• two spaces indentation
• $var = foo($bar, $baz, $quux);
• $some_array = array('hello', 'world', 'foo' => 'bar');
• <?php print $title; ?>
Top 20 mistakes you will make on your 1st Drupal project
19. FORGETTING ABOUT BACK-END UX
Drupal is criticized for having a bad user experience for end
users.
I argue that with the argument that since Drupal is a
framework, back end should be part of out efforts when
building a website.
20. FORGETTING ABOUT YOU DRUPAL WEBSITE
Drupal needs love even after you have finished your website. Keeping core
and modules updates makes it easier to upgrade at some time and
keeps the system safe.
• Read books
• Get a mentor
• Fail & learn
from it

More Related Content

KEY
Simplifying End-user Drupal 7 Content Administration
PDF
Media handling in Drupal (Drupalcamp Leuven 2013)
PDF
Preventing Drupal Headaches: Establishing Flexible File Paths From The Start
PDF
Best Practice Checklist for Building a Drupal Website
KEY
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
PDF
Drupal 8: Most common beginner mistakes
ODP
Drupal - Blocks vs Context vs Panels
PDF
Preventing Drupal Headaches: Content Type Checklist
Simplifying End-user Drupal 7 Content Administration
Media handling in Drupal (Drupalcamp Leuven 2013)
Preventing Drupal Headaches: Establishing Flexible File Paths From The Start
Best Practice Checklist for Building a Drupal Website
Learn Drupal's Most Powerful Site-Building Modules: Display Suite, Context, V...
Drupal 8: Most common beginner mistakes
Drupal - Blocks vs Context vs Panels
Preventing Drupal Headaches: Content Type Checklist

What's hot (20)

PDF
Introduction to Drupal Basics
PPTX
Drupal For Dummies
PPT
Beginner's guide to drupal
PPT
Introduction to drupal
PPTX
Complex Content Structures and Workflow with Drupal
ODP
Beginners Guide to Drupal
ODP
Drupal 7x Installation - Introduction to Drupal Concepts
PDF
Deployer - Deployment tool for PHP
PPT
Drupal - Introduction to Building Library Web Site Using Drupal
KEY
Introduction to Drupal
PDF
An Introduction to Drupal
PDF
What is Drupal? An Introduction to Drupal 8
PPTX
Using Bootstrap in Drupal 7
PDF
Site Building Checklist DrupalCamp Ottawa
PPTX
Drupal architectures for flexible content - Drupalcon Barcelona
KEY
Getting started with CSS frameworks using Zurb foundation
PDF
The Wonderful World of Drupal 8 Multilingual
PPT
Intro to drupal
PDF
Creating Landing Pages for Drupal 8
Introduction to Drupal Basics
Drupal For Dummies
Beginner's guide to drupal
Introduction to drupal
Complex Content Structures and Workflow with Drupal
Beginners Guide to Drupal
Drupal 7x Installation - Introduction to Drupal Concepts
Deployer - Deployment tool for PHP
Drupal - Introduction to Building Library Web Site Using Drupal
Introduction to Drupal
An Introduction to Drupal
What is Drupal? An Introduction to Drupal 8
Using Bootstrap in Drupal 7
Site Building Checklist DrupalCamp Ottawa
Drupal architectures for flexible content - Drupalcon Barcelona
Getting started with CSS frameworks using Zurb foundation
The Wonderful World of Drupal 8 Multilingual
Intro to drupal
Creating Landing Pages for Drupal 8
Ad

Viewers also liked (14)

PDF
Top 20 Drupal Mistakes newbies make
PDF
Web Mapping with Drupal
PPT
20130417124022809
PDF
Drupal 8, tricks and tips learned from the first 6 months
KEY
Fields in Core: How to create a custom field
PPT
Prezentacja komunikacji niewerbalnej
PDF
Attacking Drupal
PDF
Drupal commerce 2.x for Drupal 8
PDF
Creating Dynamic Landing Pages for Drupal with Panels - Webinar
PDF
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
PDF
Drupal 8 Quick Start: An Overview of Lightning
PDF
Best practices in Drupal 7 (Views, Panels ...)
PPT
5 Important Tools for Drupal Development
PDF
Build Features, Not Apps
Top 20 Drupal Mistakes newbies make
Web Mapping with Drupal
20130417124022809
Drupal 8, tricks and tips learned from the first 6 months
Fields in Core: How to create a custom field
Prezentacja komunikacji niewerbalnej
Attacking Drupal
Drupal commerce 2.x for Drupal 8
Creating Dynamic Landing Pages for Drupal with Panels - Webinar
Creating Layouts and Landing Pages for Drupal 8 - DrupalCon Dublin
Drupal 8 Quick Start: An Overview of Lightning
Best practices in Drupal 7 (Views, Panels ...)
5 Important Tools for Drupal Development
Build Features, Not Apps
Ad

Similar to Top 20 mistakes you will make on your 1st Drupal project (20)

PPTX
Drupal module development
PDF
Your first d8 module
PPT
Securing Drupal 7: Do not get Hacked or Spammed to death!
PDF
Blisstering drupal module development ppt v1.2
PPTX
Rapid site production with Drupal
PPTX
Becoming A Drupal Master Builder
PDF
The Drupal 7 Worst Practices Catalogue
PDF
Everything You Need to Know About the Top Changes in Drupal 8
PPTX
Top 8 Improvements in Drupal 8
PPTX
Drupal Skils Lab 302Labs
PPT
Drupal - Introduction to Drupal Creating Modules
PPT
Drupal: an Overview
PDF
Intro to Drupal Module Developement
ZIP
Using Features
PDF
Drupal upgrades and migrations. BAD Camp 2013 version
PDF
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
PPTX
72d5drupal
PPT
Drupal training-1-in-mumbai
PPTX
One Drupal to rule them all - Drupalcamp London
Drupal module development
Your first d8 module
Securing Drupal 7: Do not get Hacked or Spammed to death!
Blisstering drupal module development ppt v1.2
Rapid site production with Drupal
Becoming A Drupal Master Builder
The Drupal 7 Worst Practices Catalogue
Everything You Need to Know About the Top Changes in Drupal 8
Top 8 Improvements in Drupal 8
Drupal Skils Lab 302Labs
Drupal - Introduction to Drupal Creating Modules
Drupal: an Overview
Intro to Drupal Module Developement
Using Features
Drupal upgrades and migrations. BAD Camp 2013 version
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
72d5drupal
Drupal training-1-in-mumbai
One Drupal to rule them all - Drupalcamp London

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
cuic standard and advanced reporting.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Approach and Philosophy of On baking technology
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Spectral efficient network and resource selection model in 5G networks
PPTX
sap open course for s4hana steps from ECC to s4
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Spectroscopy.pptx food analysis technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Understanding_Digital_Forensics_Presentation.pptx
cuic standard and advanced reporting.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Empathic Computing: Creating Shared Understanding
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Approach and Philosophy of On baking technology
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Spectral efficient network and resource selection model in 5G networks
sap open course for s4hana steps from ECC to s4
Digital-Transformation-Roadmap-for-Companies.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
The Rise and Fall of 3GPP – Time for a Sabbatical?
Spectroscopy.pptx food analysis technology

Top 20 mistakes you will make on your 1st Drupal project

  • 2. WHO IS THIS GUY? • @iztok www.twitter.com/iztok • Drupal site builder, themer and developer • Passion about UX and design • Drupal consultant www.iztoksmolic.com • Manager at Agile Drop www.agiledrop.com • Drupal Slovenia Association organizing meetups in Ljubljana
  • 3. THE COMMON WRONG DISPOSITIONS • I know MySQL/PHP, I know Drupal • There is a module for anything like in Joomla/Wordpress • Drupal has a long and steep learning curve After 5 years I am here.
  • 5. 1. NOT KNOWING THE FURNITURE Designer must be aware of the common elements. Check this blog post from Chapter Three
  • 6. 2. OVER-DESIGNING FORMS • HTML markup is predefined for form • altering markup requires development skills Solution • Style forms: http://drupal.org/project/uniform • Group fields: http://drupal.org/project/field_group • Add element (and wrappers) with hook_form_alter
  • 7. 3. BAD CONTENT ARCHITECTURE DECISIONS • using too much content types (e.g. is Article really so different from Public release? Maybe we can use category to separate them) • not using node types (e.g. instead of listing staff as a table in the Page body, maybe build the page with Views and content type Staff member) No real formula, just practice and experiences.
  • 9. 4. WRONG FOLDER STRUCTURE If using single site installation (one Drupal core, one website) put: • themes in /sites/default/themes • modules from drupal.org in /sites/default/modules/contrib • custom modules in /sites/default/modules/custom Do not put themes and modules in the folder on the root level. Never. You can use all folder instead of default – your call. More about this: http://drupal.org/node/120641
  • 10. 5. CHOOSING UNSUPPORTED MODULE • Check the usage/download counter, last update, open issues counter, all that can give a idea about the module status. • Read the description, in many cases authors let the people know that module will be deprecated in favor of some other more comprehensive module.
  • 11. 6. ORPHANED MODULES • Clean your environment, or even better, test modules on other installations! • Leaving old, unused modules can confuse you latter on, not to mention other developers.
  • 12. 7. USING DEFAULT BLOCKS SYSTEM Use default blocks system only if project is very very simple. A couple of attempts were made to improve block system, I bet on the following two: • Context, which is block system on steroids • Panels, introduces new block-like concept
  • 13. 8. PUTTING CONTENT/CODE IN BLOCKS Default blocks allow user generated content, but you can't set permissions for editing different blocks • Bean, you can add fields to different blocks types, which have separate permissions (like content types do) • Boxes, blocks with a unique machine names
  • 15. 9. HACKING CORE/CONTRIB THEME if you decided to use a theme from core or from drupal.org, there is no need to go and edit its code. Make a sub- theme • more about creating sub- theme: http://drupal.org/node/225125
  • 16. 10. USING PAGE TEMPLATES FOR EACH SUB PAGE Try to omit page--xxx-tpl.php templates. It duplicates the code, and makes maintenance difficult. Try using Context Layout or Panels if variations are really needed. Panels have dragable user interface system and a layout generator tool. No code needed!
  • 17. 11. LOGIC IN TEMPLATES SQL queries and calculations don't belong to the template layer. If logic is not so advance it can be placed in the preprocess function in template.php file. • About process & preprocess: http://drupal.org/node/223430
  • 18. 12. USING TOO COMMON CSS TARGETING Drupal outputs a LOT of markup with specific HTML classes and ids. Knowing which class is appropriate to target is the key. • Ids are usually unique identifiers for blocks/nodes/views • views have classes with view name and display name seperated. Don’t target displays (e.g. .views-display-id- block) • .items-list, .content, .view-content etc. are used all over your Drupal site, don’t use for specific targeting.
  • 19. 13. NOT USING THE BASIC DRUPAL FUNCTIONS Drupal comes with some very handy functions, we should use them - l() and url() - in contrast of hardcoded relative URL address can outputs aliased URL path - base_path(), returns base URL of the Drupal installation - theme() functions like theme('image_style',array()) to out put styled image
  • 21. 14. CODING There is a 80% possibility that what you want to build can be build with a combination of modules. Usual suspects: • Views (your UI for SQL queries) • views_field_view, views_bulk_operations • Rules (executing commands on events) • Panels (overriding default paths like node/%nid) • Filed collection (join fields into one field)
  • 22. 15. HACKING CORE AND CONTRIB MODULES Fixing code directly in the module files makes the website impossible to update. Instead Drupal provides hooks and preprocess functions. • More about hooks: http://api.drupal.org/api/drupal/includes!module.inc/group /hooks/7
  • 23. 16. NOT USING API FUNCTIONS • Database API, dynamic queries: http://drupal.org/node/310075 • Entity query API: http://drupal.org/node/1343708 Bets to learn from examples: http://drupal.org/project/examples
  • 24. 17. NOT KNOWING HOW TO DEBUG When you would usually use print_r() to get the content of a array or object to your browser, Drupal has Devel (http://drupal.org/project/devel): • dpm($variable) – prints content of variable in human friendly way You can also store info to a log: http://drupal.org/project/object_log Can’t find the right template? Use Devel Themer (http://drupal.org/project/devel_themer)
  • 25. 18. NOT RESPECTING THE CODING STANDARDS Different approaches and coding styles make code less organized and makes the job for other developers mode difficult. • two spaces indentation • $var = foo($bar, $baz, $quux); • $some_array = array('hello', 'world', 'foo' => 'bar'); • <?php print $title; ?>
  • 27. 19. FORGETTING ABOUT BACK-END UX Drupal is criticized for having a bad user experience for end users. I argue that with the argument that since Drupal is a framework, back end should be part of out efforts when building a website.
  • 28. 20. FORGETTING ABOUT YOU DRUPAL WEBSITE Drupal needs love even after you have finished your website. Keeping core and modules updates makes it easier to upgrade at some time and keeps the system safe.
  • 29. • Read books • Get a mentor • Fail & learn from it

Editor's Notes

  • #4: I know MySQL/PHP, I know Drupal I confess that I still suck at PHP, but I can still build an advance Drupal project (even coding with Drupal “API”) There is a module for anything like in Joomla/Wordpress Drupal modules rarely bring full features like Image gallery or Slideshow, but together with Field UI, Views, Views Slideshow and Colorbox you can build a Slideshow video gallery. Drupal has a long and steep learning curve 5 years ago I was designing posters and now I help senior PHP developers understand Drupal.