Feature: "Like" specific text inside a post, not just the post itself (Video)

Hi Community,

I have a programming question related to a new feature that I am building on a theme component. I prepared a short video to demonstrate what I already have and where I am blocked.

Here is a short description though:
I want people to be able to “like” specific text inside posts (also other peoples’ posts) - not just the entire post.
Once a user selects a text, he clicks a new icon which in turn wraps the selected text with the [warp] block, which I then use to style.

The wrapping happens by modifying the raw text - which poses a problem for non-admin users who cant modify other people’s posts.

Questions:

  • I am looking for a way to save my “meta information” on the model itself.
  • I am looking for a way to modify/decorate the text in a way that every user can do it.

Thanks for your help

8 Likes

like you i’m really interested in this feature. It helps us get community input in selecting/quoting good and valuable content to host for ourselves or create a publicly shared directory.

2 Likes

I actually got this implemented in a more secure way, also using a theme component.

The goal
Give people the ability to like content inside a post, not just the post itself, e.g. people should be able to express that they like a picture specifically or text passages.

The approach
Since we are on a theme component I needed to find a way to save the meta information about such a “user like” somewhere, because apparently, only real plugins can modify the database. My initial approach was to edit the raw text of the post but this ended up being really messy since we were modifying users’ posts which we didn’t want.
The solution I ended up with was using Firebase Firestore to save things.

The result
Users can now “heart” thumbs, and texts inside LI elements and Ps.

Moving forward
I am planning on making this available as a theme component but the data storage part has to be handled by the developers themselves if they want to host the data elsewhere.

If people give enough likes I will push this out soon :slight_smile:

8 Likes

This feature could be useful for very large posts where some parts stand out more than others.
By the way, if there are multiple likes, could the 25% most liked be shown so that it is clearer? It may look very messy with lots of red lines of text all over the place.

1 Like

Sure thing, we can build whatever we want :wink: What do you mean with the most 25% percent?

1 Like

Posts that are liked higher than the third quartile (the highest 25 percent.)

1 Like

Please, release this feature soon!
I love the highlight feature on medium and now i wish it could appear in the discourse. because sometimes we will want to express our feelings on a piece of text and save it so we can review it as a bookmark feature (but currently can only bookmark the entire article) :heart_eyes:

1 Like

Hello, we have it workng stable now. Need to to code cleanup and provide a community ready version.
Perception of this is really amazing, people love it.
Will keep you posted! I hope to provide something this week.

7 Likes

This seems to be impressive work. I’d love to have a look at the code (and probably understand 30%) when it’s released. :slight_smile:

1 Like

Amaziiing! I’m anxious to see it working. Thanks!

2 Likes

Hey, guys! I had a similar idea, as I explain in this post. Do you have any news on it, @Sören_Geier?

These past few days I started considering it would be nice if, besides liking a specific part of a text, parts that were quoted had some sort of link list to every answer given to it – if you quoted this word, it’d be highlighted in the original text and, when anyone clicked this highlight they would get a preview of how many answers quoted it, whose they are etc. It’d be a nice way of understanding the depth of specific parts of a discussion.

I don’t know if my idea is clear enough haha but I imagine it would work in a similar manner as this like feature and have the same data storage issue.

Thanks :slight_smile:

1 Like

I am in talks with discourse developers to review my open source repo with the inline hearting functionality. I installed this on a clean discourse installation and it immediately worked.

The current version looks much cooler than in the first video!

Stay tuned and a bit of patience.

6 Likes

Thank you, I will definitely be one of the first to use it and give feedback on it. Have a good day

1 Like

Hello, is there anyone who can PM me to help with making the code “community ready”. I have the repo setup and ready to share but need someone upfront to do a sanity check with me and look at it from a different perspective before announcing this broadly.

Any help appreciated so I can push this forward.

1 Like