Only users can read the reply,how to enable?


#1

As we know,we can enable only users can read the content in the setting. How to enable only users can read the reply,and anoymous can only read the first post?


Help with hiding content until someone registers
(Jeff Atwood) #2

There is no way to do this in Discourse.


#3

even no plugin to realize this function?


(Régis Hanol) #4

To my knowledge, there is no such plugin either.


(Fábio Machado De Oliveira) #5

I think it may be possible to hide the replies from anonymous users with custom CSS. But I’m not sure of that, and advanced users could workaround it anyway. Would that be useful for you?


#6

Any examples? Would this be overwritten by discourse update?


(Fábio Machado De Oliveira) #7

If it works, you would put it in the customize css in the admin interface, and it isn’t overwritten by updates.


(cpradio) #8

CSS Solution (I think)

.anon div.post-cloak:not(:first-child) { display: none; }

Put that in your Customize > CSS (for both Desktop and Mobile)


(Fábio Machado De Oliveira) #9

It worked perfectly on my test instance


(Fábio Machado De Oliveira) #10

Added some red text instructing the user to login:

.anon div.post-cloak:not(:first-child) { display : none; }

.anon div.post-cloak:first-child:after { 
    font-size : large;
    color : red;
    text-align : center;
    content : 'Login to see replies'; 
    
}

On a hindsight, it would be better to just change the button text from the “Reply to Login” button


#11

The solution is really excellent.


#12

And how to change the button text from the “Reply to Login” button?


(cpradio) #13

Can you make a screenshot?

This is what I see on Meta.


#14