Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
It would be really useful to add the node type to the Heartbeat stream. For example, for "add_node" activity we have something like this:
<div class="heartbeat-activity odd heartbeat-activity-1773 heartbeat_add_node">
What would be the best way to add something like:
<div class="heartbeat-activity odd heartbeat-activity-1773 heartbeat_add_node node-webform">
Thanks!
Comments
Comment #1
Stalski CreditAttribution: Stalski commentedI think the best way would be to add a preprocessor. You can check the one in heartbeat ...
I looks like:
/**
* Process variables for heartbeat-activity.tpl.php.
*/
function yourmodule_preprocess_heartbeat_activity(&$variables) {
$variables['classes_array'][] = $message->variables['node_type'];
}
the module could be a theme as well.
How you get to the node_type property is up to you. You should dsm(devel module) what you get from the variables ...
Happy coding :)