Using this default template: hearbeat_add_node

The setup is currently: !username has added !node_type !node_title.

I would like to replace node_type with the user friendly node type name. Perhaps you could just refer me to where to get all the different variables to work with. Or... better yet request integration of the token module to more easily just copy/paste tokens right into the message fields would be very helpful.
Thanks.

Comments

Stalski’s picture

Hmm,

I think i can locate this bug. If no node type is used as variable, i add it my self (and not the friendly name). My guess is that, even when you assign your !type variable to the correct variable or token replacement, it wont work, because i override it again. My bad.
I'll fix this asap.

The second thing, you are using rules i guess? And you would like a kind of token suggestion box? This would be rather hard and not correct as i don't know the intension of the implementator.

!node_type should be [node:type-friendlyname] or something (dont know the correct variable by heart)

apmsooner’s picture

So tokens should normally work in there then? You don't have to implement a suggestion box, i know where to find tokens so if I can paste those in there to work with then I'm golden.

apmsooner’s picture

Okay, i may be a little confused here. I'm looking at the rule setups for this module and wondering how rules works with the heartbeat template setup?? In rules, i see you can specify the template to use and i guess rules actually generates the message using tokens so why the need to use variables in the heartbeat template setup also? Perhaps if i understood the intent behind how a. affects b. and vice versa then I can customize to my needs. I tried using tokens directly in the heartbeat template without success although I know rules is using them so... again I think I'm lost.

Stalski’s picture

Assigned: Unassigned » Stalski
Status: Active » Closed (fixed)

The template is just like any other template. You dont't use tokens in a template. Rules provides templates? did not know about that and i wonder if this is the case because is never saw it. I will certainly recheck this. It would not make sense anyway since rules is only an event based tool that can trigger an action when conditions are met.

I think you should read rules documentation first because the questions you are asking have nothing to do with heartbeat. In fact, they are rules related.

The reason to assign variables to tokens is because the variables are dynamic (because message templates are). It is always the same rule action, but the type of message you choose is why we have to use other variables. Variables are needed to create activity messages, while tokens are needed to give a value to the dynamic variables: a user link, a simple user name, a node name, a custom variable from a custom token (image for instance), etc ... .

Just follow the examples and read rules documentation. Heartbeat only logs activity and you can log your messages with code as well. Choose your variables wisely in the message template and it will be available in the rules you use.
It is normal when you adjust the message template that afterwards you need to alter the token assign to the "new" variables.

I am closing this ticket since all your issues seem to be about understanding rules and not about this module. If you really can't get it working, contact me at jochen@menhir.be directly.

Greetz,

Stalski

Stalski’s picture

Status: Closed (fixed) » Needs review

Well , i am opening it again because i want to recheck this issue:

I would like to replace node_type with the user friendly node type name.

Here i think of something and i really want to make sure it works.

jaochoo’s picture

I will use this issue as it is about "Customizing message template":

What information can be displayed in the heartbeat stream? In particular, is it possible to display:
- the title of a new node
- the summary/excerpt of a new blog
- the first x photos of a new photo gallery node
- the description field of a new event type node
- specific links/functions dependent on what content type the node is (e.g. if John Doe posted a new event then display a link for "RSVP" along with the update message)
- an icon dependent on the content type the node is (e.g. if John Doe posted a new event then display a little calendar icon in front, if Mary Ann posted a new blog then display a little article icon in front, etc.)

So basically make it like Facebook ;-) How far is it possible and where are the restrictions?

Stalski’s picture

Status: Needs review » Fixed

I am closing this since this issue with the node type is solved, it will be available in the dev release.

@jaochoo Everything you are asking is possible. in fact, see the demo site that is running on heartbeat and a custom module - downloadable on the demosite - and it's shows almost everything you mentioned.
I 've put a calendar, agenda, news post, etc ... icons in front of the messages. I will try to post some so you can see this working.
You're questions are rather custom and i can point you to the documentation on demosite , that is currently growing, and blog.menhir.be.

apmsooner’s picture

Thanks btw for the fix on the node type name. Look forward to getting that update.

Stalski’s picture

Status: Fixed » Closed (fixed)