Forums / Cotonti / Support / xtemplate help

fraze
#1 2012-08-15 20:55

Hi Guys

 

I'd like to be able to show a logic block to certain groups.  is there any easy way I can do this??  is the following correct?

<!-- IF  {PHP.g} >= 6  -->

 

Twiebie
#2 2012-08-15 21:56

Try this, Fraze:

<!-- IF {PHP.usr.maingrp} == 6 -->
Your block here
<!-- ENDIF -->

 

fraze
#3 2012-08-15 22:01

it doesnt appear to work unfortunately.  is there a list of the php.usr.x tags anywhere?

Added 1 minutes later:

scratch that - working now :)

Twiebie
#4 2012-08-16 01:14

If you want to allow multiple groups to access whatever is in the block you can use something like this:

<!-- IF {PHP.usr.maingrp} == 6 OR {PHP.usr.maingrp} == 7 -->
Your block here
<!-- ENDIF -->
fraze
#5 2012-08-16 09:22

i put in <!-- IF {PHP.usr.maingrp} >= 5 -->

so any user with a maingroup number higher than this can see the block.  essentially on my site it allows only admins (group 5) and custom usergroups (6+) to see the block. 

thanks for the help :)