Sand camp beginner drupal development
Transcript of Sand camp beginner drupal development
Beginning Drupal Development
Meghan Sweet (@meghsweet)26 January 2013
SANDCamp 2013
Saturday, January 26, 2013
Choosing ModulesStand on the Shoulders of Giants
- Assess the project page
- Read the README file (believe me)
- Check the issue log
- When in doubt, ask around
Saturday, January 26, 2013
http://drupal.org/project/views/
Saturday, January 26, 2013
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
Saturday, January 26, 2013
What do you need in your toolbox?HTML / CSS / Javascript / PHP
A good code editor
Firebug or Chrome Inspector
Drush
Drupal Community
Willingness to break things
Saturday, January 26, 2013
Development EnvironmentWork locally!! No more FTPing
Use version control to push changes.
Drush is your friend
You won’t regret learning command line tools
Be equipped to browser test
Saturday, January 26, 2013
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, do smart migrations
Set up a workflow to push to production
Saturday, January 26, 2013
Gall's Law
A complex system that works is invariably found to have evolved from a simple system that worked...
Saturday, January 26, 2013
Build features zoomed in, then pull back and
see how it all fits together.
Saturday, January 26, 2013
Write a development planForces 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 and get to the heart of business needs
Saturday, January 26, 2013
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
Saturday, January 26, 2013
Feature DevelopmentIts essentially three steps, rinse and repeat.
1) Build a content type
2) Build a view
3) Build a layout
(Theme)
Saturday, January 26, 2013
Common Client-side Performance PitfallsLook for the obvious first:
-Are you caching?
-Are you aggregating your CSS?
-Are the images huge?
These are stupidly easy wins :)
Saturday, January 26, 2013
Theming!
Where everything can be overridden.
Oh the power and the danger...
Saturday, January 26, 2013
Where to start
- ‘Starter’ themes- Base Themes- Responsive Theming- Click-to-Config
Develop a theming strategy and find a theme to match
Saturday, January 26, 2013
Control your layout through configurationPanels, Panelizer, Panopoly
Context
Omega
Display Suite
Saturday, January 26, 2013
Advancing Theming
Its all about Overriding
Configuration -> CSS -> PHP
Keep it clean and organized
Keep a custom module for small stuff
Saturday, January 26, 2013
Coding Standards-Don’t Hack Core! It may seems like a good idea now, but its not.
- Comment heavily! You’ll thank yourself later.
- Before you do something, consider if you can make it easier to understand. Writing code for yourself is a bad idea.
- Use descriptive classes
- http://drupal.org/coding-standards
- http://drupal.org/project/coder will check for you
- http://drupal.org/project/examples
Saturday, January 26, 2013
GIT Standards- Commit often, and do single-issue commits
- Write good commit messages, use real english and reference outside information (ticket number, Drupal.org issues)
- Remove things you don’t need with a proper commit, don’t just comment them out
Saturday, January 26, 2013
Pay it forward- Participate in the issue queue and documentation.
- If you use a patch (regardless of whether it works or fails), comment on the issue.
- If you write a patch, post it.
- Write documentation and blog
Saturday, January 26, 2013
Learn MoreBooks
Training
Documentation
Blogs
Videos
Meetups
Camps and Cons
IRC
Spirit of willingness, giving back and helping each other
Saturday, January 26, 2013