badcamp 2012 -beginner best practices

29
Beginner Best Practices Meghan Sweet (@meghsweet) 4 November, 2012 BADCamp 2012

Upload: meghsweet

Post on 27-May-2015

1.067 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: BADCamp 2012 -Beginner Best Practices

Beginner Best Practices

Meghan Sweet (@meghsweet)4 November, 2012

BADCamp 2012

Page 2: BADCamp 2012 -Beginner Best Practices

How do you learn Drupal?

Page 3: BADCamp 2012 -Beginner Best Practices

Sometimes things are really easy.

Page 4: BADCamp 2012 -Beginner Best Practices

Sometimes things are really hard.

Page 5: BADCamp 2012 -Beginner Best Practices

Leveraging Contributed Modules

Standing on the Shoulders of Giants

- Assess the project page

- Read the README file

-Views, admin_menu, ctools, webform, wysiwyg, panels, context.

Page 6: BADCamp 2012 -Beginner Best Practices

Where does Contributed code live?Put all contrib modules in ../sites/all/modules/OR../sites/all/modules/contrib

Put all custom modules in../sites/all/modules/custom

Put all themes in ../sites/all/themes

Page 8: BADCamp 2012 -Beginner Best Practices

What do you need in your toolbox?HTML / CSS / Javascript / PHP

A good code editor

Firebug or Chrome Inspector

Drupal Community

You can leverage a lot of skills you already have.

Page 9: BADCamp 2012 -Beginner Best Practices

Local Development EnvironmentLocal Environment

Drush

Version Control such as GIT

Basics of the command line

Page 10: BADCamp 2012 -Beginner Best Practices

Development WorkflowDevelopment Environment- Dev > Test > Live

Where do your clients QA?

Use Version control to push to production- great for rolling back changes- great for multi-developer environments

Code vs Content- features module

Workflow to push to production

Exclude the files directory from the repo, files are like data.

Page 11: BADCamp 2012 -Beginner Best Practices

The “Drupal Way”?

Page 12: BADCamp 2012 -Beginner Best Practices

Site Development Plan

Typical Drupal Site

Page 13: BADCamp 2012 -Beginner Best Practices

Gall's Law

A complex system that works is invariably found to have evolved from a simple system that worked...

Page 14: BADCamp 2012 -Beginner Best Practices

Build features zoomed in, then pull back and

see how it all fits together.

Page 15: BADCamp 2012 -Beginner Best Practices

Write a development plan

Forces you to think through your architecture and implications of decisions

Makes it a lot easier to build quickly- ex: grab all your modules at once, understand content and layout dependencies

Build, then theme

90% of the way there is often enough- Don’t be afraid to talk to your clients

Page 16: BADCamp 2012 -Beginner Best Practices

Structure Content

Break up your content into the pieces you want control over.

Important in mobile theming- content first

Consider your admins and your visitors.

Good content is user-centeredAdopt the cognitive frameworks of your users- E R I N K I S S A N E

Page 17: BADCamp 2012 -Beginner Best Practices

Feature DevelopmentIts essentially three steps, rinse and repeat.

1) Build a content type

2) Build a view

3) Build a layout

Page 19: BADCamp 2012 -Beginner Best Practices

Slow Site?

Page 20: BADCamp 2012 -Beginner Best Practices

Common Client-side Performance Pitfalls- Cache Settings

- Image Optimization

- Image File Subdirectories

- CSS Images

- Size of pages, libraries, CSS.

Page 21: BADCamp 2012 -Beginner Best Practices

Theming!

Where everything can be overridden.

Page 22: BADCamp 2012 -Beginner Best Practices

There is no "best" theme.

-@rupl

Page 23: BADCamp 2012 -Beginner Best Practices

Where to startDevelop a theming strategy and find a theme to match

- ‘Starter’ themes- Base Themes- Responsive Theming- Click-to-Config

Page 24: BADCamp 2012 -Beginner Best Practices

Control your layout through configurationPanels, Panelizer, Panopoly

Context

Omega

Display Suite

Page 25: BADCamp 2012 -Beginner Best Practices

Advancing Theming

Its all about Overriding

Configuration -> CSS -> PHP

Page 26: BADCamp 2012 -Beginner Best Practices

You can give back to the community.

Page 27: BADCamp 2012 -Beginner Best Practices

Coding Standards-Don’t Hack Core! It may seems like a good idea now, but its not.

- Indent of 2 spaces

- No trailing white space

- CSS properties in alphabetical order

- Comment your code, you’ll thank yourself later.

- Participate in the issue queue and documentation.

Page 28: BADCamp 2012 -Beginner Best Practices

Learn MoreBooks

Training

Documentation

Blogs

Videos

Meetups

Camps and Cons

IRC

Spirit of willingness, giving back and helping each other

Page 29: BADCamp 2012 -Beginner Best Practices

Thank You!@meghsweet

@chapter_three