XF 2.2 Chaining conditionals

Sysnative

Well-known member
I'm trying to create a template modification where the template would only be visible to these three categories:
  • Admin
  • Moderator
  • The specific user who owns the profile.

The template also has a starting condition, so it only would appear if the field was populated in the first place. Can I chain conditionals together to create a more complex conditional? E.g.

Condition 1 AND (Condition 2 OR Condition 3 OR Condition 4)


What would the correct syntax for this be?
 
In general:
HTML:
<xf:if is="$condition1 && ($condition2 || $condition3 || $condition4)">
    <!- ... ->
</xf:if>

For this case, probably something like:
HTML:
<xf:if is="$condition1 && ($xf.visitor.isMemberOf([3, 4]) || $xf.visitor.user_id == $user.user_id)">
    <!- ... ->
</xf:if>
 
Thanks for clarifying!

Thought brackets might be the answer, but couldn't find it covered in a doc (or I'm blind).
 
Back
Top Bottom