Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Get up to speed with Drupal

John Hume
February 17, 2015

Get up to speed with Drupal

Introduction to Drupal presented at the Web Workshop meetup @ Dundee Makerspace. Feb 2015

John Hume

February 17, 2015
Tweet

More Decks by John Hume

Other Decks in Programming

Transcript

  1. John Hume Web Developer for Dundee Uni Drupal Contractor Drupal

    Scotland Committee Member https://www.drupal.org/u/littledynamo @littledynamo1
  2. Overview • What is Drupal? • History • What can

    Drupal do? • Philosophy • Architecture • Building Sites • Demos
  3. Content Management System (CMS) • Manage text, images etc without

    coding • Categorise using taxonomy • Create users, assign permissions • Extend with modules • Customise look and feel via the theme
  4. Dries Buytaert Built for Antwerp University dorm mates Drop.org 2001

    – Open Sourced “Druppel” is Dutch for drop Founder of Acquia
  5. What can Drupal do? Intranet LMS eCommerce Social Network Blog

    Video Sharing Multi- Lingual Government Corporate Non-Profit News Portfolio
  6. Drupal Development Philosophy • Two releases supported at any one

    time (6 and 7) • Current Version is 7 • Drupal 8 is in beta • The drop is always moving • Upgrade path for data, not code
  7. Drupal Development Philosophy • Two releases supported at any one

    time (6 and 7) • Current Version is 7 • The drop is always moving • Upgrade path for data, not code Drupal Stack Drupal PHP Web Server (Apache, Nginx, IIS) Database (MySQL, Postgres, Oracle, MSSQL, MongoDB (D8))
  8. Drupal Development Philosophy • Two releases supported at any one

    time (6 and 7) • Current Version is 7 • The drop is always moving • Upgrade path for data, not code Drupal File Structure
  9. Drupal Development Philosophy • Two releases supported at any one

    time (6 and 7) • Current Version is 7 • The drop is always moving • Upgrade path for data, not code Drupal Architecture Modules Themes Content Types Blocks Menus Taxonomy Users Content
  10. Drupal 8 • Symfony2, PSR-4, Composer, PHPUnit, Guzzle, Assetic. •

    Configuration management – YAML • Web services in core • Twig • Views in core • In place editing & CKEditor in core • More field types, HTML5 in core, better multilingual capabilities, accessibility improvements, UI improvements • More info - https://docs.google.com/presentation/d/1GXK1dBSe6_QMhSkNwsgocWyn lzdQFrMUouaOqA8wyUI/present
  11. Content Types • Allows you to model content • News

    article and event are common examples
  12. Content Types - Fields • Many types of field (Text,

    File, Taxonomy etc) • Event content type may contain venue, date and speaker fields
  13. Content Types – Field Types • Contributed modules provide additional

    field types • Highly recommended: • https://www.drupal.org/project/entityreference • https://www.drupal.org/project/date
  14. Content Types – Demo • Create Event content type •

    Add fields for Description, Date and Location • Create a node
  15. Taxonomy • Allows categorisation • Consists of Vocabulary and Terms

    Vocabulary • Term 1 • Term 2 • Term 3 Event Type • Seminar • Workshop • Lecture
  16. Blocks • Pieces of content that can be flexibly placed

    • Modules provide additional block types Image Source: http://www.slideshare.net/davyvdb/introduction-to- drupal-2543073
  17. Blocks - UI • Blocks are placed in a region

    • Regions can be created via the theme
  18. Modules • Provide additional functionality • “There’s a module for

    that” • Download from Drupal.org • Google, ask on group sites to find modules
  19. Essential Module - Views • Views https://www.drupal.org/project/views • Retrieve and

    display content • HIGHLY configurable and extendable • Many displays (lists, tables, maps, slider, calendar etc) • Export to CSV using Views Data Export
  20. Views – Demo • Create Events listing page • Create

    map showing all events (Getlocations map allnodes)
  21. Essential Modules – WYSIWYG • https://www.drupal.org/project/wysiwyg 1. Use CK Editor

    3.6 along with WYSIWYG 2.2 2. Place CK Editor library in sites/all/libraries: 3. Enable WYSIWYG module 4. Create a WYSIWYG profile and choose the buttons you want. 5. Clear cache at /admin/config/development/performance
  22. Themes • Alter the look and feel of your site

    • Download from Drupal.org or Theme Forest etc
  23. Base Themes • Give a jump start to creating your

    own theme https://www.drupal.org/project/omega https://www.drupal.org/project/zen https://www.drupal.org/project/bootstrap
  24. Drush – The DRUpal SHell • Download and enable drupal,

    modules, themes • Install and upgrade Drupal • Sync files and database between local/prod • Run arbitrary SQL and PHP commands • Clear cache, run cron etc • https://github.com/drush-ops/drush
  25. Drush Make • Builds a drupal installation on the fly

    • Using predefined modules, themes, libraries • drush make-generate site.make • drush make site.make
  26. Drupal Resources • http://www.drupal.org/documentation • http://leveluptuts.com/tutorials/drupal-tutorials (video, free) • https://www.ostraining.com/blog/drupal/

    • https://www.acquia.com/blog/drupal-how-find-great-beginner-tutorials-drupal-7 • https://drupalize.me/ (video, subscription) • http://buildamodule.com/ (video, subscription) • IRC #drupal on freenode • http://drupal.stackexchange.com
  27. Tasks • Setup *AMP stack. • PHP version 5.3 or

    5.4 • http://www.wampserver.com/en/ • http://www.mamp.info/en/ • Install Drupal 7.34 • Drupal is on the USB or download from https://www.drupal.org/project/drupal • Add files to web folder (e.g. c:/wamp/www/drupal) • Create a database • Visit your site and follow the install instructions
  28. Tasks • Create a content type. E.g. event • Create

    some nodes of your content type. Specific events. • Install the views module • Create a view that displays your events on a page • Create a view that displays your events in a block • Add your block to the front page • Add a map to your event content type – see http://www.linuxjournal.com/content/creating-and-theming-custom- content-type-drupal-7?page=0,1 • Install drush • Use drush to download and enable some modules