Drupal Best Practices (or just good ideas) Q. Why Is it important to practice good programming habits? A. Following best practices, and thoughtful planning.

Slides:



Advertisements
Similar presentations
Become a Panels Rockstar. Audience Survey Have you tried Panels? Are you a …. –Themer / Designer? –Developer / Code Junkie? –Information Architect?
Advertisements

Lesson 15: Editing, Viewing, and Printing Worksheets.
Seattle Drupal Clinic Introduction to Drupal and Web Content Management.
Customizing your Theme Information Systems 337 Prof. Harry Plantinga.
Lesson 16 Enhancing Documents
Microsoft Office 2007: Introductory Computer Applications 11.
Pasewark & Pasewark 1 Word Lesson 8 Increasing Efficiency Using Word Microsoft Office 2007: Introductory.
Qualtrics Survey Kenyon A Beginner’s Guide.
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Getting an account with WordPress.com Open your web browser ( mozilla firefox, internet explorer, opera, etc.,)
How to Establish a Blog. What is a Blog A blog is a collection of informational articles/ideas intended to update a viewer on new information associated.
Making Accessible Drupal Sites Rick Ells UW Technology.
Pasewark & Pasewark 1 Word Lesson 8 Increasing Efficiency Using Word Microsoft Office 2007: Introductory.
Working with SharePoint Document Libraries. What are document libraries? Document libraries are collections of files that you can share with team members.
Sharepoint Portal Server Basics. Introduction Sharepoint server belongs to Microsoft family of servers Integrated suite of server capabilities Hosted.
The Dr ü G Book: An Intro to Drupal The Dr ü G Book: An Intro to Drupal (Dr ü G: Drupal User ’ s Group - users, not developers) This is an introduction.
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
Hans Hoerschelman. whoami Hans Sr. Application UI 460 Design (moonlight) UIDUG & DrupalHawks.
Drupal and the CMS Project. Lesson Learned #1 Keep your modules updated, especially when there are security concerns in the update notes 2010 | The Sky’s.
Hook, Drush, and Alters Oh Mai! Bryan Ollendyke.
Basics of Drupal: Part 2 Rochelle Terman
Designing a Presentation
TOP 20 MISTAKES YOU WILL MAKE IN YOUR 1ST DRUPAL PROJECT IZTOK SMOLIČ, ZAGREB.
Drupal in Use at Duke Duke Web Services Office of Information Technology.
Crystal And Elliott Edward M. Kwang President. Crystal Version Standard - $145 Professional - $350 Developer - $450.
South Dakota Library Network ALEPH XSL Creator © South Dakota Library Network, 2008 Modified for SDLN Version 16 Last Update: June 2008 South Dakota Library.
Go to the Destiny home page,
Creating Effective School and PTA Websites Sam Farnsworth Utah PTA Technology Specialist
Content Management Systems Drupal. Content Introduction Setting up Drupal Structure Features Core functions Comparison of Joomla and Drupal Total Cost.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
WAS to Archive-It Metadata Migration March 11, 2015.
SWC Spring 2010 Application Version SWC Spring 2010 Select Folder 2.
Presenter- Deborah Coker  Advantages of having a site  Features you may want to have on your site  Menus, Tabs, and Ribbons  Creating.
Office of Educational Technology School District of Philadelphia Introduction to Sites Google Sites This presentation is available at
VistA Imaging Capture via Scanning. October VistA Imaging Capture via Scanning The information in this documentation includes only new and updated.
Moodle (Course Management Systems). Managing Your class In this Lecture, we’ll cover course management, including understanding and using roles, arranging.
Static HTML to Drupal Theme By Ivan Zugec. Static HTML to Drupal Theme. Setting up a theme. Overriding tpl files. Using the devel module. Q and A.
Proposal for the new group web infrastructure SFT Group meeting 3/7/2009 Yves Perrin.
What you don’t know you don’t know about Drupal 6 Dan Harris daneesia on drupal.org.
Drupal Overview Prepared by : Agustin D. Gumogda Jr. Instructor.
Forensic Drupal Debugging Dan Harris daneesia on drupal.org.
OC Drupal. Steps to creating a subTheme Download base theme to “site/all/themes” folder notice: D7 will allow you to install theme from module interface.
Microsoft Office Outlook 2013 Microsoft Office Outlook 2013 Courseware # 3252 Lesson 6: Organizing Information.
Seattle Drupal Clinic Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology.
Websites with Weebly are easy!. Easy Website Creation with Weebly Holly Frilot, Library Media Specialist Collins Hill High School, Suwanee, GA.
Computer Literacy BASICS: A Comprehensive Guide to IC 3, 5 th Edition Lesson 19 Organizing and Enhancing Worksheets 1 Morrison / Wells / Ruffolo.
Drupal Theming Chris Neglia and Lisa Forgan Copyright 2009, Page 1 Solutions.
Chapter 9 Creating a Reference Document with a Table of Contents and an Index Microsoft Word 2013.
Transportation Agenda 77. Transportation About Columns Each file in a library and item in a list has properties For example, a Word document can have.
Web Site Development - Process of planning and creating a website.
2007 TAX YEARERO TRAINING - MODULE 71 ERO (Transmitter) Training Module 7 Utility Program.
Lindsey Velez, Director of Instructional Technology Single Sign-On One Click.
Drupal: Content Management and Community for your Library a panel presentation Ilana Kingsley, Univ. of Alaska Fairbanks Rasmuson Library
How to use Drupal Awdhesh Kumar (Team Leader) Presentation Topic.
THE NEW MOBILE WORKSPACE Enable Business Applications on Mobile Devices hopTo Work “I am amazed to see how easily hopTo transforms the user interface of.
SharePoint 101 – An Overview of SharePoint 2010, 2013 and Office 365
Getting an account with WordPress.com
Creating a Theme From Scratch in Drupal
Project Management: Messages
Version Control.
About SharePoint Server 2007 My Sites
Customizing your Theme
Bomgar Remote support software
Domain Matching for Contract Association Requests
Cayuse 424 Proposal Creation.
Qualtrics Survey Kenyon
SharePoint 2010 – SharePoint 101
Using Templates and Library Items
Presentation transcript:

Drupal Best Practices (or just good ideas) Q. Why Is it important to practice good programming habits? A. Following best practices, and thoughtful planning from the beginning, will ensure a well received project outcome, limiting mistakes while speeding development.

You are not #1 Don't run as admin, use an address like webmaster or Then create a second account for yourself with administrator rights with your personal address, and use that to control your site. Some sites even block user#1 so no-one can get in with those

Get update notices Create a drupal.org account if you don't already have one. Sign up for security updates here In each of your sites, go to /admin/reports/updates/settings d6 or 7 and enter that personal address to receive notices from your site/s there RUN CRON, hourly if possible

Organize your URLs When creating views, set the paths for views pages according to your architecture When constructing sites with custom node types, user's blogs, or a neat taxonomy use pathauto patterns to keep your url's organized.

Organize your file system Create separate folders in your system for attachments to each of your content types, users, taxonomy terms

Multisite installs Along with the default site which should be the master in a multisite, each site has to have it's own directory in sites/ that is the full name of the site if each is a subdomain of the default site, some hosting control panels create a sub directory for you, you have to then delete that directory then create a symlink in the docroot that points back to the docroot so Drupal can handle addressing it ln -s /var/www/html/ sub.sitename.com

Multisite installs In sites/all and/or sites/sitename create a modules and themes directory, then in modules create custom and contrib to keep drupal from slowing down keep this in mind drupal will read the directory structure it needs to build each page, so only keep what is being used by all your sites in sites/all for instance, if one of the sites is ecommerce, put those modules in that sites sites/sitename/modules/contrib directory so that other sites don't read it, but any common modules, like views, token … belong in sites/all/modules/contrib

Multisite installs on that note, only put custom mods in sites/all/modules/custom if they are being used by more than one site otherwise put them in sites/all/sitename/modules/custom the same can be said for custom themes although, I've never heard of them having custom and contrib in themes it's sufficient to put master themes in sites/all/themes and custom themes in sites/sitename/themes if using the libraries module put your libraries directory into sites/all so they are available everywhere There's one GOTCHA you should be aware of, DON'T name your module the same as your theme. Unusual behavior may ensue.

Indispensable Tools - Drush, GIT & Project Management Software INSTALL DRUSH Use Git registry_rebuild git hosting, there are a few choices, github, beanstalk, assembla some also offer issue tracking and project management

Module musts! you should be using almost all the top ten modules views, token, ctools, pathauto, admin_menu and some not so top ten that are just good suggestions like jquery_update, context, entity, module_filter, libraries, profile2, realname, file entity Advanced_help, google_analytics, workbench, rules, features and strongarm may be good ideas as well

Honorable mentions calendar, ckeditor, logintoboggan, display suite, seo_checklist, seo_checker if your not using seven as your admin theme you might want to add quicktabs module development mods include devel, coder, devel_themer, variable, drupal for firebug Security mods security review, password_policy some more suggestions FAQ, string overrides, "terms of use" or legal in other words there's a mod for that

Theming if you're creating a subtheme make your directory outside of the master theme's directory but you don't have to enable the master, but I think it would be a good idea so if there's any updates available to the master, drupal updates will let you know copy the.info file and keep certain parts plus add base theme = mastertheme so it knows where to inherit things from If you declare a region you have to declare all that you want from core too Stark and Garland don't declare any regions and inherit drupals core regions

Theming core regions Left sidebar Right sidebar Content Header Footer Highlighted Help

Theming Seven declares 5 Content Help Page top Page bottom First sidebar then hides one (regions_hidden[] = sidebar_first) I imagine only during certain circumstances and doesn't print or allow blocks to be entered into Page top and Page bottom and it doesn't inherit the others from drupal core This tells us that if you want to add your region to your theme, you have to re- declare the drupal core regions that you want to keep

Theming BTW Zen declares 9,Genesis 10,AdaptiveTheme 12,Omega 18

Theming Bartik declares 17 regions[header] = Header regions[help] = Help regions[page_top] = Page top regions[page_bottom] = Page bottom regions[highlighted] = Highlighted regions[featured] = Featured regions[content] = Content regions[sidebar_first] = Sidebar first regions[sidebar_second] = Sidebar second regions[triptych_first] = Triptych first regions[triptych_middle] = Triptych middle regions[triptych_last] = Triptych last regions[footer_firstcolumn] = Footer first column regions[footer_secondcolumn] = Footer second column regions[footer_thirdcolumn] = Footer third column regions[footer_fourthcolumn] = Footer fourth column regions[footer] = Footer

Code standards and secure code The best way to fix your site if it's broken is Googling it Google site:drupal.org “your warning or error message here”

Some last thoughts Don't hack core, but use it to learn how to add to it properly, inspect the code and the api to add functionality in your theme or module. If you want to modify an existing module, look through the issue queue for that mod, create a “feature request” issue or offer your modifications as patches. If you are going to hack an existing module to customize it to your needs and it would be too custom to give back to the community, that's ok just namespace it. If your project is acme.com (some short but descriptive name, not more than one word or acronym/abbreviation without the.com) add that to the name of the module and global replace the module's name in the code with the same convention Files get renamed acme_example.module acme_example.info acme_example.install Functions get renamed acme_example_theme() acme_example_render() acme_example_form_alter() This way you can leave the original in your module directory and receive updates to the module to adjust your version with whatever patching to remain secure and updated

Some last thoughts Most Drupal code (core and contrib) is well documented and a lot of the community is working just as hard on that as on the code itself. Look in the code of the modules/themes you want to use, a lot of them have comments that are very revealing on how it gathers and displays it's variables. Views is well commented especially the template files. Themers that have to craft views template files should copy the appropriate tpl.php file from the views/theme directory. In the views ui, expand the advanced tab on the right. At the bottom now is the theme info link, click it and an over lay will appear with the different template filenames available for each output. The one's in use are in bold, the others are suggested names for better targeting of that output. Choose the one filename that's as specific as you need, copy the bold tpl.php file from the views/theme to your custom theme and rename it with your selecion, and edit the markup and variables in that file to suit your needs. Use dsm() or dpm() to print variables you want to inspect while building the template. One gotcha, clear the cache twice to see the results of any template changes.