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.
I am trying to add some additional views fields through ds dynamic field but I am struggling with passing through the node id of the heartbeat target node from ds into views contexts. Is this possible???
Comments
Comment #1
Stalski CreditAttribution: Stalski commentedIs it possible to explain the use case, so I can try this out? Maybe the steps to reproduce (untill we come to this issue)
Comment #2
Stalski CreditAttribution: Stalski commentedComment #3
7wonders CreditAttribution: 7wonders commentedPerhaps i'm going about this the wrong way but I want to expose more fields from the node being created and node being commented on through the site activity stream. The user case is a few images and taxonomy on the node that I would like to display for each node activity in heartbeat. I figured the best way is to use ds dynamic fields and pass the "Heartbeat: Node being targeted" id to the view which would then open up all the possibility of exposing any view based on the heartbeat node contexts within the activity stream.
Comment #4
Stalski CreditAttribution: Stalski commentedIf you want to add more fields, you can do so with a ds field and there you have the object. That's the most easy way.
I must say, I always show other fields and I do this by templating. The more variables you expose in the template, the more fields you will be able to assign tokens too (via rules or through custom code). So it's just a matter of altering your template sentence and assign the correct fields to the message variables.
Comment #5
7wonders CreditAttribution: 7wonders commentedHmmm, im not really a template guy yet :) Still using gui options wherever possible!
However, I actually realised that I was going about it the wrong way for my particular purpose and that using views and heartbeat seems to work a lot cleaner (allows all the relations, arguments and so on).
I will close this as works as designed because I think what I was asking for can be done the other way around from within views anyway.
Comment #6
Stalski CreditAttribution: Stalski commentedI meant "heartbeat templates". That is all managable through UI.
The system is that a logged activity is an instance of a heartbeat template. So the template only provides a sentence like "!username created !post" leaving the !variables to be replaced at runtime to have the instances.
So if your sentence is, for instance:
Then you got a couple of other variables you can replace. in this case I would suspect in the rules ui - where you selected that heartbeat template as logging action - that you have assigned the variables with the correct tokens, specific for your needs.
So I guess you are missing the fact that a heartbeat template is a structured phrase or sentence with variables that will be replaced at runtime.
And indeed, I really would suggest not to load another view just for that. It should be very flexible, maybe not well documented :(