The discussion revolves around hiding content within a post from non-logged-in users. Marty_Downs is looking for a way to post virtual event details, including Zoom links, while restricting access to logged-in users only.
Canapin suggests using “whispers,” which can achieve similar results, but notes that they cannot be “unwhispered” after posting. Marty_Downs appreciates the suggestion but is looking for a more flexible solution.
Canapin mentions that developing a custom solution would require a plugin and could be vulnerable to circumvention by users with development experience.
Lhc_fl offers a theme component that can hide posts from non-logged-in users, providing code snippets for implementation. This solution can be bypassed by users with rich development experience, but it may serve the community’s needs.
Is there any way to make content within a post available only to logged in users?
The use case I’m thinking of is virtual event postings. We have a ton of working groups in our community that meet virtually. We’d like to let casual visitors know that the groups and meetings exist – and when they are happening – but we don’t want to post the zoom links publicly.
Thanks. That comes close. The ideal thing would be a way of formatting content within a post so that the rest of the post shows up for all and a message such as “link only available to logged-in users” shows up if you’re not logged in, but it looks like whispers will work well for now.
Newbie admin here, so still trying to find my way around all the functionality.
I don’t know much about Discourse modifications, but that seems a bit tricky and would require a plugin if you don’t want it circumvented by someone who knows how to tweak client-side code.
I’ve developed a theme component that allows to hide posts on the front end from users who are not logged in. Of course, if they are people with rich development experience, they can easily get it directly from the backend.
I haven’t packaged this component yet, so please use the code below directly.