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

XF 1.5 User Group Markup (Username CSS)

Discussion in 'Styling and Customization Questions' started by AyoubM, Sep 13, 2016.

  1. AyoubM

    AyoubM Member

    So for a specific usergroup I want to add text infront of the group members names

    Example:
    [text]Username

    So far I can only add an image infront of the name, but no text, any idea how I can do this?

    Thanks!
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    EXTRA.css:
    Code:
    .username .style1:before
    {
        content: "Text";
    }
     
  3. AyoubM

    AyoubM Member

    This is for all usernames, I just need it for users in a SPECIFIC usergroup.

    Thanks :)
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    I misread your request - check the edit.
     
  5. AyoubM

    AyoubM Member

    How would I input it in the User Group settings?
     
  6. Sheldon

    Sheldon Well-Known Member

    You'd put that in EXTRA.css
     
  7. AyoubM

    AyoubM Member

    Yes, I know.

    How can I set it in the user group settings?

    Like where do I call style1 in the user group settings?
     
  8. Sheldon

    Sheldon Well-Known Member


    You can't set it in usergroup settings, not using the :before selector... or at least not that I am aware of, I could be wrong. You have to add exactly what he posted in EXTRA.css
     
  9. AyoubM

    AyoubM Member

    If I add just that in EXTRA.css, how the bloody hell will I get it to draw for my usergroup?
     
  10. Sheldon

    Sheldon Well-Known Member

    Yes.

    .style1 is the Admin Usergroup (unless you've changed up things).
     
    Bram likes this.
  11. AyoubM

    AyoubM Member

    Thanks buddy, that's all I needed to know :)

    Works perfectly fine now.
     
  12. ArtG

    ArtG Member

    the .style1 isn't working for me. How do we know what .style is a certain user group?
     
  13. Brogan

    Brogan XenForo Moderator Staff Member

    The user group ID is the same as the style value suffix.
     
  14. ArtG

    ArtG Member

    Hmm, it doesn't work when I add the .style3:before but it does when I apply it to all user groups. Any thoughts?
     
  15. Brogan

    Brogan XenForo Moderator Staff Member

    The display styling priority must be higher than any other user groups the member is in.
     
  16. ArtG

    ArtG Member

    OK Here's what I have:

    User Group 12 has a priority of 1001 (highest).

    I enter this in Extra.css:

    .username: .style12:before
    {
    content: "Master ";
    }

    The word master doesn't appear before the username.
     
  17. James

    James Well-Known Member

    Why have you got a colon after username?
     
  18. ArtG

    ArtG Member

    Typo here. I don't have a colon in extra.css
     
  19. ArtG

    ArtG Member

    This is what I have:

    .username .style12:before
    {
    content: "Master";
    }
     
  20. ArtG

    ArtG Member

    Any thoughts? Thanks!
     

Share This Page