How to hide link in the post if user not login


(Hoang Nam) #1

I want hide link in the post when user not login, how do it with disourse.
Thank all!


(Hoang Nam) #2

who is help me?
Thank support!


(Régis Hanol) #3

Add this CSS customization

.anon .cooked a { display: none; }

(Hoang Nam) #4

Tks support team but i want display like this.
Log in or register to see the link


It is xeforo forum.
Tks to support!


(Régis Hanol) #5

Wait, you’re asking help about a XenForo forum on a forum about Discourse? :confused:


(Hoang Nam) #6

Oh No…I want to ask the function hide link on Discourse when user not login/register like Xenforo…I described in the article content.
How can do it on Discourse?
Thank support!


(Mittineague) #7

The CSS posted previously will change

If you want to <a href="http://example.com">know more</a> click here.

to

If you want to click here.

but if you want

If you want to know more click here.

AFAIK that can’t be done with CSS only and will either need JavaScript or server-side script to do.

I think using the CSS with an additional pseudo-element (::before, ::after content ?) might be easy enough if you don’t mind the links getting the same replacement.


URLs display only for registered
(Hoang Nam) #9

Thank you! But i want not display link (cant click link) when user not login/register.So must login for can click link.