Hide part of content for anonymous users

Hello, I need “hide” feature, if I paste content (text) between [hide]hidden text for forum guests[/hide] that this text can view only registered users. I’m sure this feature can be helpful for many forum owners. Thanks

5 Likes

I’m not sure that I fully understand what you’re thinking let alone know for certain how to do it :wink:

Lots of forum content can be “hidden”. Depending on what, there are

  • categories without everyone permissions
  • whisper posts (staff)
  • deleted / unlisted topics (staff / links)
  • custom CSS styles (eg. display none)
  • themes?
  • plugins?
  • spoiler (user action)
  • summary / details (user action)

You posted what looks like bbcode tags that’s use will result in text within a post not being displayed to anons.

AFAIK this in particular has not been done yet, though some of the bbcode plugins should give you a place to start.

4 Likes

There is an existing topic on this somewhere. It is a rare and obscure feature of some old forum software.

3 Likes

Sorry to bump up this old topic. I found something similar but it was about downloads, not (external) URL’S.

I can explain my reason for this feature. Some users use your forum but won’t register and only read because all they need is the information. Some people use their forum to offer support to clients, so having them sign up to see links (which are usually crucial content to understand/follow tutorials etc) is a nice trade, and gets them in your summary mailings which might convert later.

I know we can hide the forum for guests using login required feature but this is kind of aggressive and also bounces organic traffic.

4 Likes

I agree with @MarcP. Every forum need traffics but they need loyal users, not leecher.

4 Likes

I also can see a case for this and I disagree with @Mittineague answer above. There is a difference between hiding “everything” (the whole post / topic / category) and just hiding some information among some posts to incentivize guests to register. On another note, there may be forums with information targeted by scraping, this would already force to be registered (you can at least track better who does what). Hiding with CSS doesn’t help much there.

Maybe this can be achieved on a theme level ? (I don’t know)

2 Likes

I see some cases too, especially to hide/show depending on the current trust level.
F.e. in public topic there can be different links to next topics/categories that are only for particular trust level.
And it will be good to hide them from the rest of the users that will not be able to use them correctly.

1 Like

This case can sometimes be handled with custom SCSS. The user’s primary group is available as a class on the body tag of the page, so it’s possible to tweak the UI for different groups.

1 Like

@JonathanShaw Thanks for the direction!

I wonder what happens if we onebox a topic the user cannot access/see, in a topic they can? That would probably [my guess] let you “leak” out the first 500 characters [or so, a per site config] of a topic that user couldn’t see.

??

Just a small update. I actually found this plugin. It works like a charm.

It’s mildly aggressive (I set it to 1 post and no X button) but you can tune it more friendlier, but this is actually a pretty good (temporary? :flushed:) alternative for my earlier stated problem. It might be of interest to other users lurking in this topic. Good night :zzz:

3 Likes

If you only want to hide the content at the front-end level from the user, it should be achievable with a theme.

If you want to disallow that content to be sent through requests to the API from anon users (or bots, crawlers and the like), and make it so it’s not possible to see the content even if the user open the browser inspector and see the network responses, or debug the javascript, then you will probably need to have a plugin to handle that at the back-end level.

1 Like

Ok thanks. Working on the theme level would be like CSS then. Not visible, but only if you don’t look just a little better (the information is still there). :+1:

1 Like

But it’s important to note that the theme should process the post content, and that discourse already does it to convert raw text to markdown, oneboxes and so on, so it should be done in a way that does not conflict with the way it already works.

1 Like

it easy to bypass this plugin by click on login or signup then there is X button. just click it bypass :smiley:

You can disable that X button in settings.

I know. even you disabled X button you can still bypass with my method.