development based on drupal's fundamental particles - brad czerniak for jam's drupal camp

57

Upload: jeffrey-mcguire

Post on 15-Jul-2015

767 views

Category:

Internet


1 download

TRANSCRIPT

Do’s and Don’ts

Don’ts

Don’t php in your database

Don’t contemplate, and avoid building fences

Don’t install panels “just because”

Don’t commitviewsception

Don’t rush the module review process

Don’t useredundant modules

Don’t hack coreor contrib for that matter

Don’t litter

Don’t litter[seriously]

Don’t create yourown coding standards

Don’t assume yourtemplates are lonely

$output = ‘<p>’;$output .= ‘Don\’t hard-code<br />’;$output .= ‘anything more than a line’;$output .= ‘</p>;

Do’s

Do split your module folders

(contrib, custom, features)

Do usesemantically-correct fields

Do blockify

Do installeasy wins

Do let contriblead the way

Do use smtp andreroute_email on local

Do strive forreusable custom modules

Do name themes andglue-code modules for reuse

Do <front>with a blank page callback

Do themein the right place

Do make buttonsinto <button>s

Do render entitiesin Views [sometimes]

Do use chosen

Do call_user_func_array()in some overrides

Do hook_custom_access_paths()for your eck entities

Do keep an eye on page titles in dynamic views

Do label your entities

Do tokenswhen about to php your db

Do hook_field_extra_fields()for multi-field formatters

Do features by entity type(careful with field bases!)

Do .views-field-excluded {color: #888; }

in your admin theme

Do same-origin sourceyour webfonts

Do classyour view and blocks

Do make littlemedia queries

Do .first, .last, etc.for blocks, rows, everything

Do runcoder

Do rtfm