Installing heartbeat module

Installing heartbeat and it's submodules

Install heartbeat as every other drupal module. Depending on what your use case is, you will often want to enable a couple of submodules.

Note that heartbeat_example module is NOT for production usage but only shows how to implement heartbeat hooks.

Message templates are important by default from the hook_heartbeat_message_info. Each heartbeat module that holds activity message templates will display a message after install, guiding you to the templates list page. It's possible that you see more of those messages.

In case you enabled the og_activity module, you will find more streams available to you in de admin UI. This is because that module has default streams defined. This can be done custom too, just by implementing hook_heartbeat_register_access_types.

Decision time

Decide whether you going to use custom code to do the logging or use the rules module. I want to make clear that when you enable heartbeat without heartbeat_rules, it won't log anything. When using custom code, you will write them yourself and hook into the event where you can. An example of this is being done in the heartbeat_example module as well. You could just copy the code from the nodeapi implementation to have a head start.In hb_rules however, some default rules are defined that are active on install.

Manage heartbeat templates

Go to the admin/build/heartbeat/list page to add your custom message templates (or modify existing  and/or default templates)

Basic configuration

  • First some global settings: admin/build/heartbeat/settings. Note that a setting is there to block links of nodes and users. This is a setting that works with the permissions "access user profiles" and "access content".
  • Just as any other module, go to the permissions page and make sure you enabled the correct things for your site.
  • After that, we have to configure the streams. On the blocks page you will have a block for each stream, just as there is a page as well (heartbeat/%stream%)
  • When using rules, you will have to use the heartbeat logging actions (mostly for one user). Such a heartbeat activity object has the template as composition, so we for each logging action we will choose a template and assign the variables in it to tokens.

I get the question a lot whether you can define your own variables. Heartbeat variables used in the templates are free for you to define, as long as they can get a correct value for it. In custom logging, you will make sure you have the variables value. With rules on the other hand, it is possible that you need a custom token. This is an example of adding custom tokens, one for an avatar and a couple for node reference fields for an image belonging to an album.

This documentation site is for Drupal6 only.

sasda