I use drupal / 我是 OO 師,我用 Drupal

Post on 08-May-2015

2.156 views 1 download

description

從設計,工程,到系統的各種角度,分享使用 Drupal 的經驗。

Transcript of I use drupal / 我是 OO 師,我用 Drupal

我是 O O 師,我用 DRUPAL

All you need is Drupal By Chris

吳政斌 Chris Senior Drupal Developer Fliegen Creative Studio DrupalTaiwan.org Designer F2E CMS Builder WebAdmin Chocolate Design chris @ laconique.com.tw amouro @ gmail.com fb.com/amourow

吳政斌 Chris Senior Drupal Developer Fliegen Creative Studio DrupalTaiwan.org Designer F2E CMS Builder WebAdmin Chocolate Design chris @ laconique.com.tw amouro @ gmail.com fb.com/amourow

吳政斌 Chris Senior Drupal Developer Fliegen Creative Studio DrupalTaiwan.org Designer F2E CMS Builder WebAdmin Chocolate Design chris @ laconique.com.tw amouro @ gmail.com fb.com/amourow

Drupal

?

http://www.flickr.com/photos/efe6/

@Webchick / Angela Byron the first women on Linux journal that makes Linux history

? Design | FrontEnd | Backend

?

As a Designer

THEME

•  Basetheme

•  Frameworks

DRUPAL AWARE DESIGN

•  有效的運用區域 •  運用預設的 Class

THEME SETTING

BLOCK

BLOCK

D7UX

•  Our UX Principles: 1.  Make the most frequent tasks easy and less

frequent tasks achievable. 2.  Design for the 80% 3.  Privilege the Content Creator 4.  Make the default settings smart

DEV TOOLS

•  Firebug, Chrome DevTools

THEME SETTING

•  Add CSS in .info – stylesheets[all][] = style.css – stylesheets[all][] = reset.css

•  Customize tpl.php

?

As a Programmer

WORKING WITH JS

•  jQuery 1.4.4 in D7 – 1.5.1, 1.7.1, 1.8.2 (jQuery update)

•  Add JavaScript in .info – scripts[] = respond.js – scripts[] = foo.js

•  API – drupal_add_js()

drupal_add_js(drupal_get_path('theme', 'example'). '/foo.js', $options);

QUERY WITH VIEWS

QUERY WITH VIEWS

QUERY WITH VIEWS

MODULES

•  Slider – Views slideshow – Nivo slider – Galleria – Image Flow – jCarousel – 3D Views Carousel

VIEWS + VIEWS SLIDESHOW

VIEWS + IMAGE FLOW

FIELD WIDGET

HOOKS API

•  Creating a new node – hook_node_presave() – hook_node_insert()

•  Updating •  Validating

– hook_validate()

HOOKS API

•  hook_node_view

HOOKS API

•  hook_form_alter

DATABASE

•  Database abstraction layer – Built on top of the PDO library. – Different driver for each db type

•  MySQL, PostgresSQL, SQLite, MongoDB*, SQL Server*

<?php // Create an object of type SelectQuery and directly // add extra detail to this query object: a condition, fields and a range $query = db_select('users', 'u') ->condition('u.uid', 0, '<>') ->fields('u', array('uid', 'name', 'status', 'created', 'access')) ->range(0, 50); ?>

?

As a WebAdmin

PERFORMANCE IN CORE

•  Database cache •  Aggregation

– CSS – JS

CDN

•  Domain mapping •  File Conveyor

– AWS S3 – CloudFront

APC

•  Store opcode for php

MEMCACHE

•  Move db cache to memory – https://drupal.org/project/memcache – https://drupal.org/project/memcache_storage

BOOST

•  Static page cache for Anonymous

VARNISH

•  Reverse proxy – https://drupal.org/project/varnish

INTEGRATION

•  APC – cache – cache_bootstrap

•  Memcache – cache_field – cache_menu – …

•  DB – cache_filter

•  Varnish – Static page

THE MOST GEEKY CMS

•  Shell Command! •  Drush = Drupal Shell Command

– Ref. http://2013.drupalcamp.tw/session/99

•  > druah status

THE MOST GEEKY CMS

> drush dl superfish views jquery_update > drush en –y superfish > drush mb foo_module --write --name=“Foo” –dep=“views”

Chris Wu 吳政斌 chris @ laconique.com.tw amouro @ gmail.com fb.com/amourow