- Issue created by @aleix
- 🇪🇸Spain aleix
Just dropping the simple rendering of entity (with payload) as node (in 10.5) does.
- 🇧🇪Belgium swentel
Do you think that will be useful, a way to render non comment inbox (like "Create") activities? Or in this use case a new plugin to process inbox activities to nodes will make more sense ?
I think it's very useful to have rendering of this out of the box!
Currently, I'm using the reader module to view all incoming activities, but this should be possible with this module too.Not a fan to create nodes from these though. I think we can use a viewBuilder class and than use inspiration from Reader::buildMicrosubItem to render inbox activities, and maybe have different templates depending on some logic: e.g. Inbox -> like template, Inbox -> Create template, Inbox -> Announce template, Inbox -> Follow template and a 'default' one which does something clever with the payload although I have no idea what yet :)
The view builder class should split rendering between inbox and outbox, especially when 📌 Allow like/announce not having to map to entities Active is resolved. (I briefly had the idea to maybe use bundles for inbox and outbox, but view builder classes can't be split in core for now).
- 🇧🇪Belgium swentel
Regarding different templates: maybe it's better to have one template with a lot of if statements which is able to render urls, content, video images etc and then add suggestions based on $activity->getType(). cf Reader::buildMicrosubItem for inspiration.
- 🇪🇸Spain aleix
Let's see if you mean this. just a few notes here:
Instead of creating a dedicated viewBuilder for activity entity, I used the hook https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21... . This could help us as in having to maintain it. I used the new oop hook from 11 ( https://www.drupal.org/node/3442349 → ) as doing this also allows me to clean copy the buildMicrosubItem method (instead of creating a new service). The microsubitem is attached as #microsubitem in the entity render array.
Also note that Controller is moved to an extended of EntityViewController, to reuse some of its parts and easier create the entity render array.
The template part is not implemented yet and it outs the same as it was done (markup=> "Activity $id") as i'm out of time and getting too tired of nap time developing :)
With all this changes, at least one can create templates in theme side to show nice timelines.