SlideShare a Scribd company logo
1 of 29
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.
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.
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
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
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; ?>
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

What's hot

Introduction to Drupal Basics
Introduction to Drupal BasicsIntroduction to Drupal Basics
Introduction to Drupal Basics
Juha Niemi
 
Using Bootstrap in Drupal 7
Using Bootstrap in Drupal 7Using Bootstrap in Drupal 7
Using Bootstrap in Drupal 7
Ivan Zugec
 
Drupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon BarcelonaDrupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon Barcelona
hernanibf
 

What's hot (20)

Introduction to Drupal Basics
Introduction to Drupal BasicsIntroduction to Drupal Basics
Introduction to Drupal Basics
 
Drupal For Dummies
Drupal For DummiesDrupal For Dummies
Drupal For Dummies
 
Beginner's guide to drupal
Beginner's guide to drupalBeginner's guide to drupal
Beginner's guide to drupal
 
Introduction to drupal
Introduction to drupalIntroduction to drupal
Introduction to drupal
 
Complex Content Structures and Workflow with Drupal
Complex Content Structures and Workflow with DrupalComplex Content Structures and Workflow with Drupal
Complex Content Structures and Workflow with Drupal
 
Beginners Guide to Drupal
Beginners Guide to DrupalBeginners Guide to Drupal
Beginners Guide to Drupal
 
Drupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal ConceptsDrupal 7x Installation - Introduction to Drupal Concepts
Drupal 7x Installation - Introduction to Drupal Concepts
 
Deployer - Deployment tool for PHP
Deployer - Deployment tool for PHPDeployer - Deployment tool for PHP
Deployer - Deployment tool for PHP
 
Drupal - Introduction to Building Library Web Site Using Drupal
Drupal - Introduction to Building Library Web Site Using DrupalDrupal - Introduction to Building Library Web Site Using Drupal
Drupal - Introduction to Building Library Web Site Using Drupal
 
Introduction to Drupal
Introduction to DrupalIntroduction to Drupal
Introduction to Drupal
 
Drupal
DrupalDrupal
Drupal
 
An Introduction to Drupal
An Introduction to DrupalAn Introduction to Drupal
An Introduction to Drupal
 
What is Drupal? An Introduction to Drupal 8
What is Drupal? An Introduction to Drupal 8What is Drupal? An Introduction to Drupal 8
What is Drupal? An Introduction to Drupal 8
 
Using Bootstrap in Drupal 7
Using Bootstrap in Drupal 7Using Bootstrap in Drupal 7
Using Bootstrap in Drupal 7
 
Site Building Checklist DrupalCamp Ottawa
Site Building Checklist DrupalCamp OttawaSite Building Checklist DrupalCamp Ottawa
Site Building Checklist DrupalCamp Ottawa
 
Drupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon BarcelonaDrupal architectures for flexible content - Drupalcon Barcelona
Drupal architectures for flexible content - Drupalcon Barcelona
 
Getting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundationGetting started with CSS frameworks using Zurb foundation
Getting started with CSS frameworks using Zurb foundation
 
The Wonderful World of Drupal 8 Multilingual
The Wonderful World of Drupal 8 MultilingualThe Wonderful World of Drupal 8 Multilingual
The Wonderful World of Drupal 8 Multilingual
 
Intro to drupal
Intro to drupalIntro to drupal
Intro to drupal
 
Creating Landing Pages for Drupal 8
Creating Landing Pages for Drupal 8Creating Landing Pages for Drupal 8
Creating Landing Pages for Drupal 8
 

Viewers also liked

Web Mapping with Drupal
Web Mapping with DrupalWeb Mapping with Drupal
Web Mapping with Drupal
Ranel Padon
 
Prezentacja komunikacji niewerbalnej
Prezentacja komunikacji niewerbalnejPrezentacja komunikacji niewerbalnej
Prezentacja komunikacji niewerbalnej
bulinek
 
5 Important Tools for Drupal Development
5 Important Tools for Drupal Development5 Important Tools for Drupal Development
5 Important Tools for Drupal Development
jcarrig
 

Viewers also liked (14)

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

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

Drupal module development
Drupal module developmentDrupal module development
Drupal module development
Rachit Gupta
 
One Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp LondonOne Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp London
hernanibf
 

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

Drupal module development
Drupal module developmentDrupal module development
Drupal module development
 
Your first d8 module
Your first d8 moduleYour first d8 module
Your first d8 module
 
Securing Drupal 7: Do not get Hacked or Spammed to death!
Securing Drupal 7: Do not get Hacked or Spammed to death!Securing Drupal 7: Do not get Hacked or Spammed to death!
Securing Drupal 7: Do not get Hacked or Spammed to death!
 
Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2Blisstering drupal module development ppt v1.2
Blisstering drupal module development ppt v1.2
 
Rapid site production with Drupal
Rapid site production with DrupalRapid site production with Drupal
Rapid site production with Drupal
 
Becoming A Drupal Master Builder
Becoming A Drupal Master BuilderBecoming A Drupal Master Builder
Becoming A Drupal Master Builder
 
The Drupal 7 Worst Practices Catalogue
The Drupal 7 Worst Practices CatalogueThe Drupal 7 Worst Practices Catalogue
The Drupal 7 Worst Practices Catalogue
 
Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8Everything You Need to Know About the Top Changes in Drupal 8
Everything You Need to Know About the Top Changes in Drupal 8
 
Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8Top 8 Improvements in Drupal 8
Top 8 Improvements in Drupal 8
 
Drupal Skils Lab 302Labs
Drupal Skils Lab 302Labs Drupal Skils Lab 302Labs
Drupal Skils Lab 302Labs
 
Drupal - Introduction to Drupal Creating Modules
Drupal - Introduction to Drupal Creating ModulesDrupal - Introduction to Drupal Creating Modules
Drupal - Introduction to Drupal Creating Modules
 
Drupal: an Overview
Drupal: an OverviewDrupal: an Overview
Drupal: an Overview
 
Intro to Drupal Module Developement
Intro to Drupal Module DevelopementIntro to Drupal Module Developement
Intro to Drupal Module Developement
 
Using Features
Using FeaturesUsing Features
Using Features
 
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
 
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
Drupaldelphia 2013 Presentation- Making Your Site more Friendly to Search Eng...
 
72d5drupal
72d5drupal72d5drupal
72d5drupal
 
Drupal training-1-in-mumbai
Drupal training-1-in-mumbaiDrupal training-1-in-mumbai
Drupal training-1-in-mumbai
 
Drupal
DrupalDrupal
Drupal
 
One Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp LondonOne Drupal to rule them all - Drupalcamp London
One Drupal to rule them all - Drupalcamp London
 

Recently uploaded

Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
UXDXConf
 

Recently uploaded (20)

PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
AI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří KarpíšekAI revolution and Salesforce, Jiří Karpíšek
AI revolution and Salesforce, Jiří Karpíšek
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová10 Differences between Sales Cloud and CPQ, Blanka Doktorová
10 Differences between Sales Cloud and CPQ, Blanka Doktorová
 
Optimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through ObservabilityOptimizing NoSQL Performance Through Observability
Optimizing NoSQL Performance Through Observability
 
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdfSimplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
Simplified FDO Manufacturing Flow with TPMs _ Liam at Infineon.pdf
 
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdfIntroduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
Introduction to FDO and How It works Applications _ Richard at FIDO Alliance.pdf
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024Enterprise Knowledge Graphs - Data Summit 2024
Enterprise Knowledge Graphs - Data Summit 2024
 
UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1UiPath Test Automation using UiPath Test Suite series, part 1
UiPath Test Automation using UiPath Test Suite series, part 1
 
ECS 2024 Teams Premium - Pretty Secure
ECS 2024   Teams Premium - Pretty SecureECS 2024   Teams Premium - Pretty Secure
ECS 2024 Teams Premium - Pretty Secure
 
Speed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in MinutesSpeed Wins: From Kafka to APIs in Minutes
Speed Wins: From Kafka to APIs in Minutes
 
Buy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdfBuy Epson EcoTank L3210 Colour Printer Online.pdf
Buy Epson EcoTank L3210 Colour Printer Online.pdf
 
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
Secure Zero Touch enabled Edge compute with Dell NativeEdge via FDO _ Brad at...
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 

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

  • 1.
  • 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.
  • 4.
  • 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.
  • 8.
  • 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
  • 14.
  • 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
  • 20.
  • 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; ?>
  • 26.
  • 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

  1. 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.