XF 2.2 Chaining conditionals


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:
<xf:if is="$condition1 && ($condition2 || $condition3 || $condition4)">
    <!- ... ->

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

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