The discussion revolves around adding a feature to highlight self-replies in a Discourse template, similar to a messenger app. Initially, vinothkannans suggests using the .topic-owner CSS class, but nildarar clarifies that this class only applies to the topic creator’s replies.
nildarar seeks a class to highlight all replies made by the logged-in user. pmusaraj provides a JavaScript code snippet that adds a post-by-current-user class to posts made by the current user, which can then be styled using CSS. nildarar expresses gratitude for the solution, finding it simpler than expected and praising Discourse’s capabilities.
Hi,
I’m trying to add a new class to topic-post for users, seeing self replies. In fact, I am trying to show self messages with different looks in topics.
This feature is good when a template is designed like a messenger app.
But topic-owner class just assigned to replies of the topic creator. I need a class for example named my-own for adding to other replies if logged in user wrote them.
Like a messenger app, shows my replies right side and others on the left side balloon.