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

XF 1.5 Custom Message Background Color for Specific Group?

Discussion in 'Styling and Customization Questions' started by Exemption, Aug 31, 2015.

  1. Exemption

    Exemption Active Member

    I know you can do it for staff but can you do it for specific user groups?

    [​IMG]
     
  2. Ynd21

    Ynd21 Member

  3. Exemption

    Exemption Active Member

  4. Exemption

    Exemption Active Member

  5. Ynd21

    Ynd21 Member

    Hope this helps! 2015-08-30_2243 - Joshie787's library - If not you can add me on Steam or something and I can walk you through it.

    You add the xen helper string to messages and not extra.css
     
  6. Exemption

    Exemption Active Member

    Hmm this is what I have currently:

    EXTRA.CSS
    Code:
    .message.owner {
    background-color: #FF8787;
    }
    MESSAGE
    Code:
    <xen:require css="message.css" />
    <xen:require css="bb_code.css" />
    <xen:require css="xb_message.css" />
    
    <li id="{$messageId}" class="message {xen:if $message.isDeleted, 'deleted'} {xen:if '{$message.is_staff}', 'staff'} {xen:if '{xen:helper ismemberof, $message, 3}', 'owner'} {xen:if $message.isIgnored, ignored}" data-author="{$message.username}">
    <xen:if is="@xb_message_layout == 1 OR @xb_message_header">
        <div class="messageHeading">
    Of course not all of them, only the main area where the code is involved.
     
  7. Ynd21

    Ynd21 Member

    And this is how your css is now (or was, looks like it was removed after I looked) showing

    <li id="post-5914" class="message staff owner " data-author="Exemption">

    So you have yourself marked as staff still, and it added owner to the end. Remove yourself from the staff list and it'll show up as class=message owner, or you can try
    .message.staff owner {
    background-color: #FF8787;
    }
     
    Last edited: Aug 31, 2015
  8. Exemption

    Exemption Active Member

    Done but how do I do the whole message? Not just the box Screenshot
     
  9. Ynd21

    Ynd21 Member

    Weird..on my forums it makes the entire thing the proper color (2015-08-30_2336 - Joshie787's library)

    What theme are you using? Could just be how it's styled. I looked at your css and I actually couldn't find the css string anymore (but it could just be I did something wrong)

    Got it, you made the message content red, not the actual class you need.

    You have
    .owner .messageContent {
    background-color: #FF8787;
    }

    You need

    .message.staff.owner {
    background-color: #FF8787;
    }

    Like this

    2015-08-30_2342 - Joshie787's library
     
    Last edited: Aug 31, 2015

Share This Page