• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Show text to members only? (Need!)

#1
Hi,

I am looking for a way to hide certain text to members only. I assume there is an add-on to do this, I just can't find it.

I guess it would be something like this; You put the text inside a tag, such as "[hidden]Member only text[/hidden] and it only shows that text for registered users.

Here is an example from God*Craft*com:


The text that says "<<You must be .... to View this information>>" is what it says for non-registered users. Any other users can view it if they are a member.


Thanks,
 

Chris D

XenForo developer
Staff member
#2
You don't need an add-on for this.

XenForo has a number of template conditionals.

To do what you want:

Code:
<xen:if is="{$visitor.user_id}">
This content will show to logged in members
<xen:else />
This content will show to guests
</xen:if>
Put that code in the desired template.
 

DBA

Well-known member
#3
Where is this text going?

Here's a simple conditional for templates
Code:
<xen:if is="{$visitor.user_id}">
This content will show to logged in members
<xen:else />
This content will show to guests
</xen:if>

Edit: Got ninja'd. :p
 
#4
You don't need an add-on for this.

XenForo has a number of template conditionals.

To do what you want:

Code:
<xen:if is="{$visitor.user_id}">
This content will show to logged in members
<xen:else />
This content will show to guests
</xen:if>
Put that code in the desired template.
Alright, thank you a lot :>
 

Chris D

XenForo developer
Staff member
#5
Where is this text going?

Here's a simple conditional for templates
Code:
<xen:if is="{$visitor.user_id}">
This content will show to logged in members
<xen:else />
This content will show to guests
</xen:if>

Edit: Got ninja'd. :p
We really need some banner that appears when someone else is writing a message.

Either that, or a proper ninja smiley for when the inevitable happens ninja.png