NOTE:This presentation is a Work in Progress. The current copy shared is intended only for review purposes by the DCD panel.
How “N O T”to build Drupal SitesTanay SaiTechnical Account ManagerAcquia
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
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
Do “NOT” hack core● Why?
● Use Hooks, APIs from core
and contrib
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
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()
Do “NOT” put code in database● PHP Filter
● Views PHP module
● Why?
● Common Scenarios
● Alternative better approaches
Do “NOT” clutter your site● Dozens of unused modules,
content types, vocabularies
● Be a miser
Do “NOT” Content Typify Everything● Use Custom Entities
wherever Appropriate
Do “NOT” just MYISAM● InnoDB vs MyISAM
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
Do “NOT” default your FILTERS● Input Formats
● Filters
Do “NOT” leave out CACHING● Block Caching● Page Caching● Views Caching● Entity Cache module● Boost/Varnish● Memcache● APC
● Set appropriate cache lifetimes● Page Compression● CSS/JS Aggregation
Do “NOT” Log Everything Everywhere● Disable DB Log● Enable Syslog● Disable Statistics, Use GA or
similar
Do “NOT” leave UI modules enabled● UI Modules
● Simpletest
● Migrate
● Migrate Extras
● Coder
● Devel
Do “NOT” Use them. Stay Away!● Statistics
● ..
● ..
●
Do “NOT” Leave behind 404● Use Fast 404
● Prevent Bootstrap and
Database operations for that
favicon which is always
missing
Do “NOT”