XF 2.3 Conditional Banner

I added a styling for both moderator and administrator groups, but the administrators account has both banners appearing as they're in both groups. What would be the best way of setting conditional settings. So if the user has the administrator banner showing, moderators wouldn't appear?

1753141045737.webp
 
Solution
So the answer to this is doing this in the extra.less file:
Less:
.userBanner--syl_staff_administrator + .userBanner--syl_staff_moderator,
.userBanner--syl_staff_moderator + .userBanner--syl_staff_administrator {
  display: none;
}

Just for a little context my banners are this in my app_user_banners.less:
Less:
    &.userBanner--syl_staff_administrator {
      .m-userBannerVariation(white, #c0392b, #a93226);
      box-shadow: 0 0 8px 2px rgba(192, 57, 43, 0.7);
    }

    &.userBanner--syl_staff_moderator {
      .m-userBannerVariation(white, #2980b9, #1f6391);
      box-shadow: 0 0 6px 1.5px rgba(41, 128, 185, 0.6);
    }
So the answer to this is doing this in the extra.less file:
Less:
.userBanner--syl_staff_administrator + .userBanner--syl_staff_moderator,
.userBanner--syl_staff_moderator + .userBanner--syl_staff_administrator {
  display: none;
}

Just for a little context my banners are this in my app_user_banners.less:
Less:
    &.userBanner--syl_staff_administrator {
      .m-userBannerVariation(white, #c0392b, #a93226);
      box-shadow: 0 0 8px 2px rgba(192, 57, 43, 0.7);
    }

    &.userBanner--syl_staff_moderator {
      .m-userBannerVariation(white, #2980b9, #1f6391);
      box-shadow: 0 0 6px 1.5px rgba(41, 128, 185, 0.6);
    }
 
Solution
Back
Top Bottom