Site Building

Rules Bonus Pack: Using Rules for Presentation Altering for Drupal 7

This page is archived

We're keeping this page up as a courtesy to folks who may need to refer to old instructions. We don't plan to update this page.

Alternate resources

Rules guide (Drupal.org)

Sprout Video

This screencast shows how you can use Rules to alter the presentation of your Drupal site, such as:

  • Enabling, disabling and moving blocks around
  • Setting HTML title element and also on-page titles
  • Setting body classes
  • Setting the active menu item (using Menu Position)

Some bigger questions about using Rules for altering presentation is also discussed:

  • Using Rules for presentation altering is relatively heavy. (It consumes about 2.5 MB more PHP memory than Context, and has about the same loading times – judging from a first, rough comparison.)
  • Using Rules for presentation altering gives a more complex UI than the interface use for modules made for more particular use cases.
  • It is possible for modules to provide alternative user interfaces to Rules.
  • Rules allows reusing actions in many different situations, between different modules.
  • Rules (and Entity API) provides generalized data handling.

Additional resources

Rules guide (Drupal.org)

Legacy Site Building