The Rules Way of Life Presented by Wolfgang Ziegler, Johan Falk - - PowerPoint PPT Presentation

the rules way of life
SMART_READER_LITE
LIVE PREVIEW

The Rules Way of Life Presented by Wolfgang Ziegler, Johan Falk - - PowerPoint PPT Presentation

The Rules Way of Life Presented by Wolfgang Ziegler, Johan Falk Wolfgang Ziegler // d.o. fago wolfgangziegler.net twitter.com/the_real_fago Johan Falk // d.o. Itangalo nodeone.se/johan-falk twitter.com/itangalo Rules?


slide-1
SLIDE 1

The Rules Way of Life

Presented by Wolfgang Ziegler, Johan Falk

slide-2
SLIDE 2

Wolfgang Ziegler // d.o. fago

wolfgangziegler.net twitter.com/the_real_fago

Johan Falk // d.o. Itangalo

nodeone.se/johan-falk twitter.com/itangalo

slide-3
SLIDE 3

Rules? http://drupal.org/project/rules

slide-4
SLIDE 4

Reactions Event-Condition-Action

slide-5
SLIDE 5

Rules 2.0-rc1 for Drupal 7 What's new?

slide-6
SLIDE 6

Data selection

slide-7
SLIDE 7

Switch parameter input modes

This is the message.

slide-8
SLIDE 8

Create components!

 Reusable configurations.  Rule sets, Action sets, Condition sets  Use them in reaction rules or other modules.

slide-9
SLIDE 9

Loops & Lists

slide-10
SLIDE 10

Improved debug log

slide-11
SLIDE 11

The Rules way of life

slide-12
SLIDE 12

Drupal is like Lego

Nodes, Fields, Views, …

+

glue code

slide-13
SLIDE 13

Drupal is like Lego

Nodes, Fields, Views, …

+

Rules

slide-14
SLIDE 14

Drupal is like Lego

Nodes, Fields, Views, …

+

Rules

+

less glue code

slide-15
SLIDE 15

Interacting modules.

slide-16
SLIDE 16

"The whole is more than the sum of its parts." – Aristotle

slide-17
SLIDE 17

The holy four!

  • i. Views

ii.Flag iii.Rules iv.Message

slide-18
SLIDE 18

Modules to be replaced...

Scheduler, Workflow, Pathauto, Notifications, Messaging, Casetracker, Custom breadcrumbs, … your custom module?

slide-19
SLIDE 19

Is this a good idea?

slide-20
SLIDE 20

Let's do „Feature modules“?

Modules

 have more dependencies  become harder to understand

→ Just as the sites we build

slide-21
SLIDE 21

Feature modules

→ Re-use existing stuff → Less work → Less code to maintain → More flexible solutions → Easy to adapt!

slide-22
SLIDE 22

Share and remix custom-tailored solutions!

slide-23
SLIDE 23

Examples

slide-24
SLIDE 24

Mark as spam

 Flag (Mark as spam / Mark as ham)  Rules:  Unpublish content marked as spam  Block spam users  Notify moderator about new content  Messages for spam history

slide-25
SLIDE 25

Simple workflow

 Workflow state field

(draft, needs-review, published)

 Field permissions  Message + Rules for logging changes  Views for content listings, message logs.  Rules for publishing, notification

slide-26
SLIDE 26

Scheduled publishing

 Date fields for publishing + unpublishing date  Rules Components for

(Un-)Publishing + Logging

 Reaction rules that  detect changed (un-)publishing dates  schedule component evaluation

slide-27
SLIDE 27

Notifications

 Flag „Subscribe to a node“  Rule „Notify subscribers of changes“  Rules component „Notify a user“  User account field „Notification settings“

e.g. for choosing messaging channel

slide-28
SLIDE 28

Demo

slide-29
SLIDE 29

Best practices...

 Make use of tags!  Use components to organize your rules  Export rules to feature modules using Features  Fear the devil: PHP module.  Keep your rules simple

slide-30
SLIDE 30

Useful modules

slide-31
SLIDE 31

Views Bulk Operations

http://drupal.org/project/views_bulk_operations

Execute Rules components on Views-results.

slide-32
SLIDE 32

Rules Link

http://drupal.org/project/rules_link

Create custom links which trigger rules.

slide-33
SLIDE 33

Content Access

http://drupal.org/project/content_access

Grant role-based access to nodes with rules.

slide-34
SLIDE 34

Rules Bonus Pack

http://drupal.org/project/rb

A greenhouse for Rules functionality.

slide-35
SLIDE 35

Developing with Rules

slide-36
SLIDE 36

Extend Rules

 Provide events, conditions and actions  Define entity properties using

hook_entity_property_info of the entity API

 Provide new entity types

slide-37
SLIDE 37

Make use of the Rules API

 Actions API  Conditions API  Provide configurable components  Embed the UI, write tests!

slide-38
SLIDE 38

Developments & Outlook

 Usability  Development ideas  Views, ctools, Entity forms, Web hooks  Drupal 8

– Entity API with Entity Property API – Condition, Action API

slide-39
SLIDE 39

Thanks! Questions?