Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Rapid site production with Drupal


Published on

This was created for a code camp presentation at my office.

Published in: Technology
  • Be the first to comment

Rapid site production with Drupal

  1. 1. Rapid Creation with Drupal
  2. 2. What is Drupal? • Drupal is a free open-source software package distributed under the GPL (“GNU General Public License”) that allows an individual or a community of users to easily publish, manage and organize a wide variety of content on a website. • Common uses: – Community web portal – Discussion sites – Corporate websites – Intranet applications – Personal web sites or blogs – E-commerce applications – Resource directories – Social Networking sites
  3. 3. First steps • Download it at • Learn the concepts • Learn how to just walk away (any open source software has its quirks) • Know where to find help – #drupal-support ( – #drupal-consultants (find paid help) – #drupal (
  4. 4. Concepts of Drupal • Drupal allows for more abstraction than a typical CMS. It’s more of a “builders kit” made up of pre-designed components (“modules” in Drupal terminology) that can be used as-is or that can be reconfigured to meet your needs. • Page handling – It’s common to think of a website as a collection of pages, with some functions thrown in to round it out. In this case you would think of editing in a tree-like hierarchy of pages. – Drupal, on the other hand, treats most content types as variations on the same concept: a node (more on these in a bit). Pages, blog posts and news items (some possible node types) are all stored in a common pool, and the sitemap is an overlay that is designed separately by managing and editing navigation menus. • Nodes hold the structured information pertaining to a blog post (such as title, content, author and date) or in a news item (title, content, go-live date, take-down date), while the menuing system creates the sitemap as a separate layer. • Other elements (node layout themes, and modules like Views and Panels) provide the onscreen display of node contents.
  5. 5. The install:
  6. 6. The install:
  7. 7. The install:
  8. 8. The install: • Create a database using phpMyAdmin or whatever you are comfortable with. • Create a user that has permissions to this database.
  9. 9. Errors? • Don’t use Safari, use Firefox • I had the menu_router error when using Safari and it was solved by using Firefox on the install (who knows?). –
  10. 10. The install:
  11. 11. The install:
  12. 12. Yep, that’s what you get!
  13. 13. The Drupal Flow • There are 5 main layers in the Drupal system: diagram from
  14. 14. At the core is the “bucket” of nodes – the data 1. pool. Before anything can be displayed it must be input as data. 2. The next layer (from center) is where modules live. Modules are functional plug-ins that are either a part of the Drupal core (ship with Drupal) or contributions from the community. 3. Next we have blocks and menus. Blocks can be diagram from configured in various ways, as well as only showing on certain defined pages, or only for certain defined users. Menus are displayed in blocks. 4. User permissions are next and these are where settings are configured to determine which things different user types have access to. 5. Next is the surface layer which is the site template. This contains most of the XHTML and CSS, with some PHP tokens sprinkled throughout to insert content from the system into correct spots.
  15. 15. What is a node? • Cluster of related bits of data. When you create an article or a new blog post, you are actually creating a collection of things such as title, content, author link, creation date, etc. • Think of a node as a single puzzle piece • Using the CCK (Content Construction Kit) you can create as many custom nodes as you want. • Each node has a type, referred to as a Content Type. • Every node has an ID, a Title, a Body (can be disabled), a creation date, an author and some other properties. • All nodes are stored in your database table.
  16. 16. More about modules • You can download modules from – • Make sure to download a module that is compatible with your current Drupal install version.
  17. 17. More about themes • There are many themes available for download at – • Much like modules, you need to make sure you download a theme that is appropriate to your version of Drupal. • Included in each template is a set of functions that can be used to override standard functions in the modules in order to provide complete control over how the modules generate their markup. • Templates can be assigned on-the-fly based on user permissions.
  18. 18. Adding features to your system • Upload module/theme to the system • Activate with Drupal control panel • If the module is a block type module then visit the blocks admin page and add the new block type to an area of the page. • Check the user permissions admin page and see if there are new permissions for this module.
  19. 19. Drupal has many tables • At its core it has around 50 tables • Users have their own tables, and some of them are authors or nodes. Nodes have relations. • – “Load all pertinent information for node 1982, including whatever relations (comments, users, etc.) are to be shown” • Most queries are hard-coded into modules.
  20. 20. Awesome Modules • CCK (Content Creation Kit) – – Allows you to add custom fields to nodes using a web browser • Additional modules to use with this module: – computed field: lets you add a PHP-driven quot;computed fieldquot; to CCK node types – date: creates an ISO or unix timestamp date field – email: validated email field – image field: an image field – link: a URL field
  21. 21. Awesome Modules • Views – – Allows a Drupal designer to control how lists and tables of content are presented. – Essentially a smart query builder that, given enough info, can built the proper query, execute it, and display the results.
  22. 22. Awesome Modules • Admin Menu – – Easy to use administration menu – See it in action 8U
  23. 23. Time to play! • The best way to learn sometimes is to dive in and start messing around.
  24. 24. Enabling Clean URLS Make a .htaccess file in the root of your drupal directory and add the following: RewriteEngine on RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
  25. 25. Sources • definitions and diagrams from