Resource icon

XF 2 Tip Conditional Statements for XenForo 2

LQD

Active member
Registered
Joined
Nov 15, 2018
Messages
33
Points
43

Reputation:

ENXF submitted a new resource:

Conditional Statements for XenForo 2 - Guide and tutorial for conditional statements using XenForo 2 syntax

Conditional Statements for XenForo 2

The conditional statements can be expanded by using AND, OR conditional statements operators and using xf:if, xf:else, xf:elseif.

If there are any conditional statements that you want to add, please add it as a message and the article will be updated.

1. How can I show content to Administrators?
Code:
    <xf:if is="$xf.visitor.is_admin">
        Show content...
    </xf:if>
2. How can I show content to Moderators?
Code:
    <xf:if...

Read more about this resource...
 

Nulled2

Well-known member
Registered
Joined
Dec 10, 2019
Messages
202
Points
38

Reputation:

I want to create a navigation menu, that only shows the conditional for registered users without VIP, how could I do it and how would it go there?
 

Nulled2

Well-known member
Registered
Joined
Dec 10, 2019
Messages
202
Points
38

Reputation:

I mean, show it only to users who are NOT in that user group?
 

johnth

Member
Registered
Joined
Nov 1, 2022
Messages
19
Points
3

Reputation:

i want to show threads created by specific usergroups in widget, how can i achieve this
 

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,497
Points
523

Reputation:

View previous replies…

johnth

Member
Registered
Joined
Nov 1, 2022
Messages
19
Points
3

Reputation:

not that I know, because how you want to get all threads with a display condition?
BattleKing
Screenshot-2022-11-05-134115.png


This is what i need :giggle:
 
Top