XF 2.2 XenForo Template Syntax for User Upgrades?

KensonPlays

Well-known member
I searched and could find nothing for this specifically. Is it possible to create content in an HTML page that's only visible to people with a User Upgrade active?

I know <xf:page option="section">pageAbout</xf:page> can be used to select which navigation tab is shown, but is there something I can use to either put the whole page to be only visible by paid upgraded accounts, or a two-parter for content in between it I can put on top and bottom lines?
 
Solution
The upgrades do grant roles (4 of them for 4 tiers). So I'd have to grant it to all 4 roles. But I could find a template syntax for logged in, is admin, is mod, but not for "is X roles (4 of em)
For member group check, this should work, even though it's about ads.
The upgrades do grant roles (4 of them for 4 tiers). So I'd have to grant it to all 4 roles. But I could find a template syntax for logged in, is admin, is mod, but not for "is X roles (4 of em)".
 
The upgrades do grant roles (4 of them for 4 tiers). So I'd have to grant it to all 4 roles. But I could find a template syntax for logged in, is admin, is mod, but not for "is X roles (4 of em)
For member group check, this should work, even though it's about ads.
 
Solution
Thanks, This page: https://xenforo.com/docs/dev/template-syntax/ does not have "member" in it. Ctrl + F showed 0 results for "member"
 
Thanks, This page: https://xenforo.com/docs/dev/template-syntax/ does not have "member" in it. Ctrl + F showed 0 results for "member"
Find it's simpler to do a search on the site itself... your asking if a member is, so I searched for ifmember using what I had seen the syntax of before.
Reason I remembered it
 
I don't like to necro year old threads, but it shows "X" once, could I do it with X,X,X" with three role ids?
Pretty sure that second link I gave you shows exactly that... specifically dealing with the moderator and administrator group.
And it's not that old of a thread, being from July 6 this year.
 
One more thing, is it possible to do an elseif for all other roles to display a "you to not have permission to view this page"?

I tried: <xf:else /> CONTENT HERE </xf:if> as the very last lines at the end of the page node.
Basically, all other roles, including staff. I want ONLY the roles with perms at the start of the page to see the content, but I want literally everyone else, including staff if they don't have the secondary role, to NOT see the page (private game server information)

Code:
<xf:if is="{{$xf.visitor.isMemberOf([7, 8, 9])}}">
Page Content Goes Here
<xf:elseif blocking all other roles including staff>
<strong>You do not have permission to view this page.</strong>
</xf:if>
 
Top Bottom