janboddez / indieblocks

Use blocks, and, optionally, "short-form" post types to more easily "IndieWebify" your WordPress site.
https://indieblocks.xyz
GNU General Public License v3.0
22 stars 3 forks source link

Consider another block for displaying just Likes and Reshares #41

Closed jasontucker closed 1 year ago

jasontucker commented 1 year ago

Using the Full Site Editor to edit the comment section on my website I'm wondering if there is a good way to be able to separate the links and reshares so they can be stylized differently. I'm not sure about removing them from the other comments, maybe by comment type?

janboddez commented 1 year ago

The way Semantic Linkbacks---I think (?), it's one of the other/older IndieWeb plugins---does this, is offer the option to group Likes and Reposts above regular comments, in a "facepile"---i.e., just people's avatars, kind of like Twitter likes?

See also https://github.com/janboddez/indieblocks/issues/25.

But a block is a good idea, hadn't really thought of that!

janboddez commented 1 year ago

Thought we could use pre_get_comments to add a meta query (webmention types are stored in comment metadata) and filter out likes and reposts, but meta queries screw up the comment count that is used to determine whether to show the comments block at all ...

What might work is use the comment type after all, and not just add webmention but, e.g., also webmention_like, etc.

Think the Webmention plugin just fetches them all and just skips over likes etc. it encounters, but I'm not sure if that wouldn't screw up pagination etc.

jasontucker commented 1 year ago

I think something like this would allow for people to see the activity relating to their content on the fediverse on their own website. True, Semantic Linkbacks has that facepile functionality so having something similar either in the form of a list of people that liked and reshared the content would be helpful or some other form of presenting the activity or even encouraging more of it.

janboddez commented 1 year ago

Thought we could use pre_get_comments to add a meta query (webmention types are stored in comment metadata) and filter out likes and reposts, but meta queries screw up the comment count that is used to determine whether to show the comments block at all ...

Maybe we could try this here filter: https://github.com/pfefferle/wordpress-webmention/blob/4b1c1dfaf0480d7280afa0cd31fd297658926302/includes/class-comment-walker.php#L20

janboddez commented 1 year ago

Latest GitHub version has a "Interactions" block for this.

To avoid comments showing up twice (i.e., as a regular comment and inside the Interactions block), enable the "Facepile" setting (under Settings > IndieBlocks > Webmention).

Caveat: the Interactions block won't display more than 25 reactions/avatars. I'll address that later on. Also, there's no preview inside the block editor (yet).

janboddez commented 1 year ago

Quick screenshot (from https://indieblocks.xyz/stream/481ebec3c6/):

image

How it works:

  1. In the Single template (this here example is Twenty Twenty-Three), add a Facepile block before the Comments blocks. Had to change the Facepile heading's font size to "large" to get it to look the same as the comments title.
  2. Under Settings > IndieBlocks > Webmention, enable the “Facepile” bookmarks, likes, and reposts option. This will remove bookmarks, likes, and reposts from the regular comment list, and adjust the comment count accordingly.

image

Of note: It uses custom fields to filter out these mention types, and does not yet support the Webmention plugin. (Only "IndieBlocks'" webmentions are supported right now.)

janboddez commented 1 year ago

I kinda want to still add a bit of CSS to make clear which avatars represent likes and which ones are reposts, etc. (There is currently no way of separating these out, i.e., having different "kinds" of "Facepile" blocks in one template.)

It is possible to change the heading to "Interactions" or "Engagement" or whatever else, or delete it.

janboddez commented 1 year ago

Closing this as the Facepile block is now live (there’s smaller issues with it, still, but we’ll address those elsewhere).