Drupal Architecture and functionality

43
Hong Kong Drupal User Group (HKDUG) Workshop & Sharing 2014 December 13th

Transcript of Drupal Architecture and functionality

Page 1: Drupal Architecture and functionality

Hong Kong Drupal User Group(HKDUG)

Workshop & Sharing

2014 December 13th

Page 2: Drupal Architecture and functionality
Page 3: Drupal Architecture and functionality

Wong Hoi Sing, Edison

● CEO, Founder, PantaRei Design– 2009, PantaRei Design founded

– 2010, HKFYG YBHK applicant

– 2011, ITF SERAP applicant

– 2011, HKSTP Incu-Tech applicant

● FOSS and Drupal Developer, Contributor and HKDUG Co-founder– 2000, Debian GNU/Linux 2.2 ('potato')

– 2005, Drupal Developer

– 2008, BarCamp HK Speaker

– 2008, HKDUG Co-founder

– 2011, Drupal 7.x Core Contributor

[email protected]● https://www.drupal.org/u/hswong3i

Page 4: Drupal Architecture and functionality

PantaRei Design

● Hong Kong based FOSS service provider– Content Management System (CMS) with Drupal

– Cloud Hosting Solution with Amazon Web Services (AWS)

● Business Partner with industry leaders– 2012, AWS Consulting Partner

– 2013, Acquia Partner

– 2013, Atlassian Experts

– 2014, Rackspace Hosting Partner

Page 5: Drupal Architecture and functionality
Page 6: Drupal Architecture and functionality
Page 7: Drupal Architecture and functionality

Outline

● What is Drupal?● Evaluate Drupal Project Online● Scalable & Modularized Architecture● Export Settings with Features● Revision Control with GIT

Page 8: Drupal Architecture and functionality

What is Drupal?

● Drupal is an open-source platform and content management system (CMS) for building dynamic web sites

● Distributed under the terms of the GNU General Public License (or "GPL"), which means anyone is free to download it and share it with others

● To easily organize, manage and publish your content, with an endless variety of customization

Page 9: Drupal Architecture and functionality
Page 10: Drupal Architecture and functionality
Page 11: Drupal Architecture and functionality
Page 12: Drupal Architecture and functionality

Evaluate Drupal Project Online

● http://simplytest.me/● On-demand sandbox environments● No overhead for setup LAMP stack● Simple, fast and for free!● Let's try it now!

– http://simplytest.me/project/drupal/7.x– http://simplytest.me/project/drupal/8.x

– http://simplytest.me/project/drustack/7.x-26.x

Page 13: Drupal Architecture and functionality
Page 14: Drupal Architecture and functionality
Page 15: Drupal Architecture and functionality
Page 16: Drupal Architecture and functionality
Page 17: Drupal Architecture and functionality
Page 18: Drupal Architecture and functionality
Page 19: Drupal Architecture and functionality
Page 20: Drupal Architecture and functionality

Evaluate Drupal Project Online (cont.)

● Check “Status report” page ● Add new article● Add new main menu link● Add new block to region● Add new user● Change look & feel (theme)● Change system settings

Page 21: Drupal Architecture and functionality

Scalable & Modularized Architecture

● Why?– Easy for implementation

– Reduce team development overhead

– Managable and redeployable

● How?– Categorizing changes in different level

– Export data/settings with Features

– Manage revision with GIT

Page 22: Drupal Architecture and functionality

Scalable & Modularized Architecture (cont.)

● Categorizing– Global modules configuration (Module)

– Content types (CCK)

– Dummy data (UUID Features)

– Filtering logics (Views)

– Contextual conditions and reactions (Context)

– MISC

– Look & feel (Theme)

Page 23: Drupal Architecture and functionality

Module

● Review your project requirement● Choose which modules/distribution would be suitable,

e.g.– https://drupal.org/project/commerce_kickstart

– https://drupal.org/project/commons

– https://drupal.org/project/drustack

● Enable and configure– admin/config

– admin/structure

Page 24: Drupal Architecture and functionality

Content Construction Kit (CCK)

● Content type is the main container for CMS– admin/structure/types

● Group your content type by functionality– i.e. share same fields structure

– Moreover, use Taxonomy to label different purpose

● Keep It Simple Stupid (KISS)● Less is More● CCK is in Drupal 7 core!

Page 25: Drupal Architecture and functionality

UUID Features

● Node/Term with UUID = Features exportable● Taxonomy term related to filtering logic should

be export with UUID Features– i.e. can remap with UUID in Views

● Usually, only basic pages should be export with UUID Features– Dynamic content migration should consider Migrate

● Patches required

Page 26: Drupal Architecture and functionality

Views

● Filter content with no custom code nor SQL required– admin/structure/views

● Manage with GUI● Supported by most 3rd party modules● Exportable with Features

– Good combo with Taxonomy + UUID Features!

● Views is in Drupal 8 Core!

Page 27: Drupal Architecture and functionality

Context

● Manage contextual conditions and reactions for different portions– admin/structure/context

● Very flexible and powerful (i.e. by rules)– Drupal default with by blocks

● Reuse theme predefined regions– Panels default custom layout and design

● Exportable with Features– Good combo with Taxonomy + UUID Features!

Page 28: Drupal Architecture and functionality

MISC

● Custom blocks– https://drupal.org/project/boxes

– https://drupal.org/project/bean

● Custom modules● Additional functionality

Page 29: Drupal Architecture and functionality

Theme

● Site should work well even with Drupal default theme

● Keep away from custom PHP logic– Try to implement with previous level

– Reduce backend dependency

● Don't hack core– Overriding with themable output

Page 30: Drupal Architecture and functionality

Export Settings with Features

● By default, modules settings store in database– variable_get(), variable_set(), variable_del()

● Features can export these dynamic changes into a new custom module (a.k.a. Features export)– https://drupal.org/project/features

● After export, latest changes can compare with archived version, and (partly) rollback or recreate

Page 31: Drupal Architecture and functionality
Page 32: Drupal Architecture and functionality

Export Settings with Features (cont.)

● With Scalable & Modularized Architecture– Export each layer, each group of configuration, individually

● Team development can be workout by sharing code, and maintain own environment independently– Shared testbed (i.e. single copy of code + database) no

longer required

● Redeployable– i.e. Continous Integration (CI) possible

Page 33: Drupal Architecture and functionality

Export Settings with Features (cont.)

● Knowledge management become possible● Reduce development risk● Reduce on going maintenance overhead

Page 34: Drupal Architecture and functionality

Revision Control with GIT (cont.)

● CSV– Manage revision per file (rename not support)

– Remote repository server required (no local folder offline management)

– Single commit management (other else contribute by submit patches)

– TOOOOO OLD (well...)● Used by Drupal during 7.x development cycle● After Drupal 7 released, soon migrated to GIT

Page 35: Drupal Architecture and functionality

Revision Control with GIT (cont.)

● SVN– Manage revision per folder

– Remote repository server required

– Single commit management

– A bit better than CSV, but branching model still looks crazy

● At least, we now have GIT, why still using SVN?

Page 36: Drupal Architecture and functionality

Revision Control with GIT (cont.)

● GIT– Manage revision per entire project

– Remote/local repository supported● git init● git add --all ● git commit -am 'Initial commit'● git push● git log● git status

– Distributed workflows

– Used by https://drupal.org/ since Drupal 7

– You also know https://github.com/, isn't it?

Page 37: Drupal Architecture and functionality
Page 38: Drupal Architecture and functionality
Page 39: Drupal Architecture and functionality

Revision Control with GIT (cont.)

● Drupal configuration goes dynamic● Features export make it as static files● Static files revision control by GIT● Team members can therefore share progress

by managed code with GIT● Project manager (PM) can review individual pull

request submitted by team members, and fully test before commit to main stream

Page 40: Drupal Architecture and functionality
Page 41: Drupal Architecture and functionality

Q&A

Page 42: Drupal Architecture and functionality

I Need More Help!

● Read documents from Drupal Community– https://drupal.org/documentation

● Join Hong Kong Drupal User Group– http://www.meetup.com/Hong-Kong-Drupal-User-Group/

– https://groups.drupal.org/hong-kong

● Contact us for one (1) month free-trial support service– [email protected]

Page 43: Drupal Architecture and functionality

Thank You

● Please feel free to contact us:– PantaRei Design Limited– Unit 326, 3/F, Building 16W

No.16 Science Park West AvenueHong Kong Science Park, Shatin, N.T.

– Phone: +852 2576 3812

– Fax: +852 3753 3663– Email: [email protected]– Web: http://pantarei-design.com