Presentation is loading. Please wait.

Presentation is loading. Please wait.

 Hooks, tokens, rules, elements, plugins Developing for Drupal the “right” way “I know a way” (c) Saul Berrenson.

Similar presentations


Presentation on theme: " Hooks, tokens, rules, elements, plugins Developing for Drupal the “right” way “I know a way” (c) Saul Berrenson."— Presentation transcript:

1  Hooks, tokens, rules, elements, plugins Developing for Drupal the “right” way “I know a way” (c) Saul Berrenson

2 Who am I?  Head of Web-development for Axel Springer Russia  Author of 20+ contrib modules  Maintainer of several other contrib modules  Module application reviewer  Recently a father to a cute daughter Anastasia

3 Plan first, code second  You should know the code flow before writing anything  Plan for flexible and light architecture  Think about exposed APIs your module would need

4 Utilize Drupal’s best parts  Drupal is really good in text filtering, but only server-side (PHP code)  Paste Format uses Drupal text filtering features to filter the pasted text (and you rule what actually gets filtered and what stays in your content)

5 Tokens  Expose your module information to other modules  Examples  HybridAuth and uLogin modules use it to expose social information

6 Rules  Rules are ruling  Power and flexibility  Examples  HybridAuth and uLogin  Yandex Webmaster Original Texts

7 Views Bulk Operations  Batch API  Queue  Very useful for content manipulations  You just need to code the actual changes

8 Elements  Easy to reuse in any renderable array  #properties to control your element  Study drupal_render() to understand the rendering flow  ‘#pre_render’ is really powerful

9 Plugins  Views, Panels use it – and you should  Flexible architecture  Eases maintenance and support (Image Editor)  Allows other developers to extend your module  Drupal 8 does the same

10 What a plugin is?  Array of properties utilized by another module  Properties may be function callbacks

11  Most popular content Module design example

12 Most popular content  Always fresh statistics  By day, week, month  By content section on our site  No load on our servers  Is there a module for that?

13

14 https://www.drupal.org/sandbox/chyvakoff/2370095

15 Thank you! andrew.berezovsky@gmail.com


Download ppt " Hooks, tokens, rules, elements, plugins Developing for Drupal the “right” way “I know a way” (c) Saul Berrenson."

Similar presentations


Ads by Google