Think Like a Drupal Developer
Upcoming SlideShare
Loading in...5
×
 

Think Like a Drupal Developer

on

  • 1,790 views

Drupal is hard. It's not just a CMS, it's not just a framework, it has the power of both and the simplicity of neither. So where do you get started?...

Drupal is hard. It's not just a CMS, it's not just a framework, it has the power of both and the simplicity of neither. So where do you get started?

This session will bring developers new to Drupal up-to-speed on exactly what they need to know to tackle that next big Drupal project. You will learn not about the newest and greatest modules and performance tricks, but instead about how a Drupal developers thinks and solve problems. Once you understand what Drupal wants from you, it's much easier to conquer any crazy requirement a client may give.

The best Drupal developers are lazy developers. Meaning that they only develop what's necessary to solve the problem and use the wealth of contributed modules to help them get there. Many new developers coming from handmade web sites tend to over-develop and waste time solving problems others have already solved or problems Drupal can already solve for you. This session will make you more efficient, saving you time and helping you get your projects out the door faster!

Statistics

Views

Total Views
1,790
Views on SlideShare
1,788
Embed Views
2

Actions

Likes
2
Downloads
19
Comments
1

1 Embed 2

http://www.linkedin.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Looks like a great preso, but much of the text is unreadable :(
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Think Like a Drupal Developer Think Like a Drupal Developer Presentation Transcript

  • Think  Like  a  Drupal  DeveloperErik WebbTechnical Consultant, Acquia Drupalcamp Atlanta 2011
  • Who  am  I?• Joined Acquia in April 2010• 30+ clients in almost 2 dozen states• Systems administrator background (RHCE)• LAMP development (10+ years PHP)• Go Jackets! Drupalcamp Atlanta 2011
  • Who  are  you? Drupalcamp Atlanta 2011
  • Drupal  is  hard.  Its  not  just  a  CMS,  its  not  just  a  framework,  it  has  the  power  of  both  and  the  simplicity  of  neither.  So  where  do  you  get  started? Drupalcamp Atlanta 2011
  • How  Drupal  works1. Lookup URL in aliases, menu router2. Check for cached page3. Check permissions for page4. Run page callback5. Process render array Drupalcamp Atlanta 2011
  • What  Drupal  Can  Do• Managing lots of structured data• Strictly manage access to content and functionality• Providing an organized administration section• Allowing themers great flexibility• Using common page layouts Drupalcamp Atlanta 2011
  • Coders  vs.  Builders• We’re all developers• Good Drupal developers are “lazy” • Efficiency beats all • Enjoy your weekends!• Trust the community• Rethink problems, not solutions Drupalcamp Atlanta 2011
  • Building  vs.  Coding• Building • Coding • Flatter learning curve • Steep learning curve • Easier transition for “web • Easier transition for developers” programmers • More maintainable* • Less maintainable* • Dependent on community • Customized to client • Book learnin’ • Blood, sweat, & tears • Faster development • Faster performance* • Reusable solutions • One-off advantages Drupalcamp Atlanta 2011
  • What  to  code Drupalcamp Atlanta 2011
  • Modifying  Forms• hook_form_alter(), hook_form_FORM_ID_alter()• Administrative and user-facing forms• Examples • Making individual fields required • Changing order of fields • Adding help text • Additional validation or submission handlers Drupalcamp Atlanta 2011
  • Changing  Nodes• Structure • Presentation • hook_node_view() • template_preprocess_nod • Add new data e() • Modify existing data • Reformat data • Change data in all places • Combine into pseudo- fields • NEVER alter data, treat as read-only Drupalcamp Atlanta 2011
  • Menu  Manipulation• hook_menu_alter()• Change menu properties • Hide links globally • Change title • Change permissions • Override callbacks• Efficient, runs only on cache clear Drupalcamp Atlanta 2011
  • When  to  code  or  build Drupalcamp Atlanta 2011
  • Content  Aggregation• Views • EntityFieldQuery • Graphical setup • Full control* • Community-driven • Low overhead • Built-in caching • Extremely Drupal-specific • Many display options • No SQL! • Efficient prototyping • Combine with Entity Load Cache* Drupalcamp Atlanta 2011
  • Contextual  Changes• Context module • hook_boot(), • Flexible API hook_init() • Easily exportable to code • Completely custom • Extendable by non-coders • Performance-focused • Handling condition and reactions Drupalcamp Atlanta 2011
  • ExamplesDrupalcamp Atlanta 2011
  • Client:  Anytime  an  anonymous  user  visits  a  news  article,  I  want  to  show  them  a  modal  with  a  subscription  link. Drupalcamp Atlanta 2011
  • Use  Context• Wrong way • template_preprocess_node() to add JS in a theme• Right way • Create a modal reaction for Context • Why not use hook_boot()?• Right way • Use pure JavaScript to check for body.logged-in CSS class Drupalcamp Atlanta 2011
  • Client:  I  don’t  want  anonymous  users  seeing  any  content  tagged  with  the  “Internal”  keyword. Drupalcamp Atlanta 2011
  • Nodes  are  everywhere!• Wrong way • hook_node_access() doesn’t affect the menu• Wrong way • Override ‘access callback’ for URL ‘node/%’• Wrong way • hook_node_view() returns drupal_access_denied()• Right way • hook_node_access_records() changes all node accessing Drupalcamp Atlanta 2011
  • Client:  I  want  all  checkboxes  to  be  those  cool  image  buttons  instead  of  the  normal  checks. Drupalcamp Atlanta 2011
  • Form  altering  isn’t  always  the  right  way• Wrong way • Use CSS/JS to change input[type=”checkbox”]• Wrong way • Use hook_form_alter() to change the ‘#theme’ property for all checkboxes to your theme function• Right way • Simply create modulename_checkbox() to override all uses of the form element Drupalcamp Atlanta 2011
  • Client:  I  want  to  incorporate  my  company-­‐wide  header/masthead  into  my  Drupal  site. Drupalcamp Atlanta 2011
  • iframe?  What  is  this,  1999?• Wrong way • Hard code into an include file in your theme• Wrong way • Recreate the header using Drupal’s menu system and CSS• Right way • Create a JS include somewhere else• Right way • Use a web service to retrieve the HTML (and cache it!) Drupalcamp Atlanta 2011
  • Questions?Ask me - @erikwebb on Twitter Drupalcamp Atlanta 2011