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

Collaborate
Collaborate
Registered
Joined
Dec 10, 2019
Messages
223
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

Collaborate
Collaborate
Registered
Joined
Dec 10, 2019
Messages
223
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,529
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:
 

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
27,551
Points
823

Reputation:

ENXF NET updated Conditional Statements for XenForo 2 with a new update entry:

Added Conditional Exceptions (40-54)

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?...

Read the rest of this update entry...
 
Top