DeltaHF
Well-known member
I want to control which user groups see ads.
I know the ismemberof helper exists and accepts multiple user group IDs, but I'd like to keep maintenance simple and abstract this logic into a type of function, so I only have to define these user group IDs in one place. Ideally, this would enable me to simply use something like this in templates:
What's the best method for me to do this? Should I create my own helper or plugin, or might there be an easier way I'm not familiar with?
I know the ismemberof helper exists and accepts multiple user group IDs, but I'd like to keep maintenance simple and abstract this logic into a type of function, so I only have to define these user group IDs in one place. Ideally, this would enable me to simply use something like this in templates:
HTML:
<xen:if condition="{showAds}">
<!-- ad code here -->
</xen:if>
What's the best method for me to do this? Should I create my own helper or plugin, or might there be an easier way I'm not familiar with?