How to hide part of the html code?

offline

Posts

6

Likes

3

Bits Credits

0

LEVEL

0

185 XP

I created a page with html code in the nodes.
I understand how to hide the page from the guests in principle through the node/rights settings, but this option is not suitable.
How can I hide part of the html code on this page from the guests?

To make it more clear:

Code:
<footer>

<!-- for all -->
<p>Hello all world</p>

<!-- for members only -->
<p>Hello wolrd</p>

</footer>
 

FateKid

Devil Did It
offline

Posts

15,604

Likes

150,425

Resources

3,100

Bits Credits

685

LEVEL

11

5,910 XP

Done, i found
Code:
<xf:if is="{$xf.visitor.user_id}">
That works, yes. This Xen IF statement will compare the user's ID.
If the user indeed does have an ID number, that does mean they are not a guest.

You can also use things like this (checking if a user is indeed part of a group or groups.
HTML:
<!-- If user is part of group (singular) -->
<xf:if is="$xf.visitor.isMemberOf(X)"> </xf:if>

<!-- If user is part of group (array, multiple) -->
<xf:if is="$xf.visitor.isMemberOf([X,X])"> </xf:if>

There's a lot of explore in the XenForo syntax. I'm sure you'll enjoy reading this.
 
Top Bottom