1. NOTE:
This presentation is a Work in Progress. The
current copy shared is intended only for
review purposes by the DCD panel.
2. How “N O T”
to build Drupal
Sites
Tanay Sai
Technical Account Manager
Acquia
3. Do “NOT” code too much
● Do not program too much
● When you have a hammer
everything looks like a nail
● Don't be in a rush to become
a Drupal "Programmer"
● Do not try to solve the
Problem by Programming
4. Do “NOT” custom code too much
● Hard to Maintain
● Leverage existing good
contrib modules
● You are just re-inventing the
wheel
● Contrib code tested and
reviewed by many
5. Do “NOT” hack core
● Why?
● Use Hooks, APIs from core
and contrib
6. Do “NOT” be too generic
●
●
●
●
●
hook_init, hook_boot
form_alters without check for
form if
Including JS, CSS through these
init hook
403 - Use Drupal's permissions
system instead
Overriding other module’s
behaviour - Use
hook_menu_alter,
hook_form_alter etc instead of
hook_init
7. Do “NOT” get into trouble
●
●
●
hook_init
hook_boot
hook_exit()
●
●
●
hook_node_access()
hook_node_access_records()
hook_node_access_alter()
●
●
hook_node_grants()
hook_node_grants_alter()
8. Do “NOT” put code in database
● PHP Filter
● Views PHP module
● Why?
● Common Scenarios
● Alternative better approaches
9. Do “NOT” clutter your site
● Dozens of unused modules,
content types, vocabularies
● Be a miser
10. Do “NOT” Content Typify Everything
● Use Custom Entities
wherever Appropriate
12. Do “NOT” default PERMISSIONS
●
●
●
Do not leave any permission
checked or unchecked by default
Uncheck all and start checking
one by one after putting some
thought
Whenever is new module is
added check the permissions
added and see the roles that
these permissions were granted
to