MG 2.1 Media Slider widget conditionals

South Fork

Active member
I'd like to improve my forums usage / display of the best (personally selected) photos that exist within our xFMG. I've got a couple "xFMG: Media Slider" widget requirements I'm trying to figure out below. Help?
  • Filter photos by tag(s) instead of by category(s)
  • Limit widget to specific user group(s) (easy conditional. see below)
Looking through things, it seams the only options is to move chosen media items to a specific category to pull this off. Not a big level of effort but it's not ideal if they are categorized correctly to begin with.
  • Media slider only seams to work displaying latest. Random breaks it.
  • Chris's post on user groups display conditional...
You can do user group checks too:

(Visitor is member of groups 3, 4 or 5)
$xf.visitor.isMemberOf([3, 4, 5])
(Visitor is not a member of groups 3, 4, or 5)
!$xf.visitor.isMemberOf([3, 4, 5])
(Visitor is a member of group 3, but not group 4)
$xf.visitor.isMemberOf(3) AND !$xf.visitor.isMemberOf(4)
And so on. You can also do permission checks directly:
$xf.visitor.hasPermission('general', 'view')
Last edited: