Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.



Published on

  • Be the first to comment

  • Be the first to like this


  1. 1. Rules
  2. 2. Data selection
  3. 3. Loops
  4. 4. Examples
  5. 5. Mark as spam <ul><ul><li>Flag (Mark as spam) </li></ul></ul><ul><ul><li>Rules: </li></ul></ul><ul><ul><ul><li>Unpublish spam comment </li></ul></ul></ul><ul><ul><ul><li>Block spammer </li></ul></ul></ul><ul><ul><ul><li>Notify moderator about bad user </li></ul></ul></ul><ul><ul><li>Messages in spam log  </li></ul></ul>
  6. 6. Moderators' workflow <ul><ul><li>Fields: </li></ul></ul><ul><ul><ul><li>Moderation status field </li></ul></ul></ul><ul><ul><ul><li>Unpublish date field </li></ul></ul></ul><ul><ul><li>Fields permission  </li></ul></ul><ul><ul><li>Rules for publishing and notification. </li></ul></ul><ul><ul><li>VBO and Rules for bulk operations </li></ul></ul><ul><ul><li>Message module for logging changes </li></ul></ul><ul><li>  </li></ul>
  7. 7. Demo
  8. 8. Useful modules:
  9. 9. Rules Bonus Pack Aditional triggers, actions and conditions.
  10. 10. Views Bulk Operations Run Your rules on the views-result.
  11. 11. Flag Trigger rules on flag/unflag any item.
  12. 12. Rules Link Create links which trigger rules.
  13. 13. Page Manager User rules conditions to check access for page.
  14. 14. Content Access   Give role-based access to nodes with rules.
  15. 15. Relation Work with related entities and create relations.
  16. 16. Difference in performance *Measurement was made on page load Rules Custom module Update user's name after account was updated. ~177,57 ms ~174,35 ms Update user's name after node was viewed. ~230,5 ms ~193,06 ms
  17. 17. Difference in performance
  18. 18. What does it mean? <ul><ul><li>~40 ms additional page execution time </li></ul></ul><ul><ul><li>~3 ms additional queries execution time </li></ul></ul><ul><ul><li>~17 additional exuquted queries </li></ul></ul><ul><ul><li>~3,5 mb additional RAM usage. </li></ul></ul>
  19. 19. Development <ul><ul><li>Provide your own ations and conditions using :  </li></ul></ul><ul><ul><ul><li>hook_rules_action_info()  </li></ul></ul></ul><ul><ul><ul><li>hook_rules_condition_info()  </li></ul></ul></ul><ul><ul><li>Define entity properties using hook_entity_property_info of the entity API </li></ul></ul>
  20. 20. Use Rules because:  <ul><ul><li>Rules is flexible </li></ul></ul><ul><ul><li>Rules is more clear for a customer </li></ul></ul><ul><ul><li>Rules intagrates with other modules </li></ul></ul><ul><ul><li>You can easily move needed functionality using Features </li></ul></ul><ul><ul><li>Clicking is faster that writing a code </li></ul></ul>
  21. 21. Useful Links <ul><ul><li>Code exampels: </li></ul></ul><ul><ul><li>Documentation: </li></ul></ul><ul><ul><li>Screencasts:  </li></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><ul><ul><li> </li></ul></ul></ul><ul><ul><li>Moderations' workflow feature: </li></ul></ul>
  22. 22. Questions? Yaroslav Doroshuk email: skype: yarroha twitter:!/yarroha blog: