Frequently Asked Questions
I cannot give an answer to that because there are just too many reasons for causing this. I hope your specific question and/or use case is within the next part.
Do you have permissions to access content and view user profile?
Note that heartbeat does not know about links being used in the messages. For this reason heartbeat set the choice to show these messages OFF by default. So you have two options here:1) Enable the setting, allowing all messages showing links (or not even using links at all) and have a small problem with the access denied page, or 2) Leaving it disabled and never show messages that have a node or user within the context of the message. Together with this setting you should enable the drupal permissions "access user profile" and "access content" for that matter. Since this is the default setting i prefer doing things this way. The decision is based on the fact that this is a community module and users should see content and user profiles.
Is the database correctly filled?
You can always check the database table heartbeat_activity to see if your message was logged. The message field should be a proper already built and well-formed message.
Recheck the access on the messages
Check if the messages are not blocked by message type role permissionCheck if the messages are not blocked by the user disabling that message typeCheck if the stream allows that mesage typeCheck if no filter is blocking the message from stream
See the heartbeat_example module and heartbeat_rules to see specific tokens generally usable within the streams. user-name-url is one of them. Check this page with an advanced token example with avatars and album pictures.
Yes you can, You can register an access type or stream and create your own query, joining node and/or user instead of wanting to load them afterwards. You can even extends the HeartbeatActivity object (MyActivityObject) and thus add member properties to it. In fact you extend every class in heartbeat and let everything go your way. Check organic groups implementation on how to totally alter the query and activity result sets.
This is possible. You have several options to achieve that:
- You can put a token in the message template configuration, for instance !avatar. E.g.:
<div class="avatar">!avatar</div><div class="message">!username just created !page.</div>
- Using heartbeat API: In your call to the heartbeat api function, you create !avatar variable yourself.
- Rules: If you are using rules, you have to assign this avatar variable to the corresponding token. The token is the clue here. You will have to create this in a custom module. There is an example at "creating your own custom tokens."
- You can implement hook_heartbeat_theme_alter where you alter the message. In heartbeat_example module is a great example on what you need. I prefer this way because it's cleaner to separate message types showing the user avatar or another icon for "status messages". E.g. Event calendar, blogpost icon, ...
- Confirm with the drupal theming, "heartbeat_message_row" is alterable in the template file and it's preprocessor. In the variables section ready for theming, $variable['message'] is available. This is a valid HeartbeatActivity object that holds the uid, and even the actor user object. So this makes it very easy to create the avatar (with imagecache or not).
- Display Suite way. Just create a field that will work with creates an avatar for the acting user.
Yes. As every heartbeat template will have its own set of variables, we need to be able assign the correct specific token to each of those variables. So the choice is most of the time at the heartbeat template level. Heartbeat templates are just a format of a dynamic sentence.
You could have more rules that log to the same heartbeat template, when the structure and available tokens will match.
Before starting to work with heartbeat templates, you should have written all formats that will be used in the site. After that, you need to see which use cases will use the same template. As soon as something is not a variable and it differs from another template, you need to separate them. The result here will most of the time be that you need another rule as well. It's a bit of common sense i persume here.
This is not something that is normal behavior for heartbeat. You need to see it as heartbeat being the leading module for displaying activity. So in the case of fbss, shouts, tweets, ... we have to make sure we log the message (with template) in the heartbeat table and heartbeat activity messages will have comments, flags, ... . The don't add-up as in the question imo. In this specific case, we would make a ilike flag for a heartbeat activity message for the heartbeat streams. fbss flags will only be shown in the fbss stream pages. The reason for this is that both modules have there own tables, with own unique identifiers.
When heartbeat is there, then views lists, fbss views, or other contribs blocks will be the list to use for activity.
Here we have to take care of the "context". when we are in OG, we need to make sure heartbeat knows about the extra contextual variables. In heartbeat templates, variables will become valuable as soon as something gets logged in the database.
Underneath a couple of possible cases:
- "!user posted !title in !group. "
There are three variables where title is the group post title and group is the top group name.
The other query variables will be set-up like
- userId: poster
- userTargetId: 0
- nodeId: the id of the post
- nodeTargetId: the id of the topgroupname the post is in. - "!user joined !group. "
There are two variables where group is the top group name.
The query variables will be like:
- userId: actor
- userTargetId: 0
- nodeId: the (top) group nodeId
- nodeTargetId: 0