• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Postbit styling per usergroup issues

Autonamus

Active member
#1
Hey all,

Excuse any mistakes made in this as I am tired which as it happens is the main reason for my issue I believe.

I am trying to style the postbit depending on the usergroup using <xen:if is="{xen:helper ismemberof, $user, x}" > with a <style type="text/css"> in it.

I have this code in a template I have made which I am then linking with <link rel="xenforo_template" type="text/html" href="template.html" /> but keep getting met with errors like (depending what template I try and link into (Page_container for this example))

Template Errors: PAGE_CONTAINER

Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be of the type array, null given in /home/***********/public_html/library/XenForo/Template/Helper/Core.php, line 1310:
1309: ';
1310: if ($tabs['inbox']['selected'])
1311: {
Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be of the type array, null given, called in /home/***********/public_html/library/XenForo/Template/Helper/Core.php on line 1318 and defined in /home/***********/public_html/library/XenForo/Model/User.php, line 1627:
1626: ';
1627: if ($extraTabs['home'])
1628: {
Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be of the type array, null given in /home/***********/public_html/library/XenForo/Template/Helper/Core.php, line 1310:
1309: ';
1310: if ($tabs['inbox']['selected'])
1311: {
Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be of the type array, null given, called in /home/***********/public_html/library/XenForo/Template/Helper/Core.php on line 1318 and defined in /home/***********/public_html/library/XenForo/Model/User.php, line 1627:
1626: ';
1627: if ($extraTabs['home'])
1628: {
Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be of the type array, null given in /home/***********/public_html/library/XenForo/Template/Helper/Core.php, line 1310:
1309: ';
1310: if ($tabs['inbox']['selected'])
1311: {
Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be of the type array, null given, called in /home/***********/public_html/library/XenForo/Template/Helper/Core.php on line 1318 and defined in /home/***********/public_html/library/XenForo/Model/User.php, line 1627:
1626: ';
1627: if ($extraTabs['home'])
1628: {
Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be of the type array, null given in /home/***********/public_html/library/XenForo/Template/Helper/Core.php, line 1310:
1309: ';
1310: if ($tabs['inbox']['selected'])
1311: {
Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be of the type array, null given, called in /home/***********/public_html/library/XenForo/Template/Helper/Core.php on line 1318 and defined in /home/***********/public_html/library/XenForo/Model/User.php, line 1627:
1626: ';
1627: if ($extraTabs['home'])
1628: {
Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be of the type array, null given in /home/***********/public_html/library/XenForo/Template/Helper/Core.php, line 1310:
1309: ';
1310: if ($tabs['inbox']['selected'])
1311: {
Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be of the type array, null given, called in /home/***********/public_html/library/XenForo/Template/Helper/Core.php on line 1318 and defined in /home/***********/public_html/library/XenForo/Model/User.php, line 1627:
1626: ';
1627: if ($extraTabs['home'])
1628: {

NOW, I am sure (well it's kinda obvious) that I am doing something wrong, and most likely doing it completely backasswards and longwinded but any advice would be great.

I am effectively editing these elements of css for a few different usergroups using the following code as an example.

HTML:
<xen:if is="{xen:helper ismemberof, $user, 6}" >
    <style type="text/css">
        .messageUserBlock div.avatarHolder {
        background-color: rgb(240, 247, 252)!important;
        }
        .messageUserBlock {
        background-color: rgb(217, 237, 247)!important;
        border: 1px solid rgb(188, 232, 241)!important;
        }
        .messageUserBlock h3.userText {
        color: rgb(58, 135, 173)!important;
        text-align: center!important;
        }
        .messageUserBlock a.username {
        color: rgb(58, 135, 173)!important;
        }
    </style>
</xen:if>