XF2 Tutorials Postbit Borders (Group Based)

XenBD

Administrator

Staff member
This will add a border to the left of posts and it's done by CSS, in this example i different posts between group types with color:

firefox_shtagXta6j.webp

To achieve this you can do it in the following templates:
Code:
conversation_message_macros
post_macros
profile_post_macros

Today i will show you the post bit only.

So let's open post_macros and search for:
HTML:
<div class="message-cell message-cell--user">

Replace it with:

HTML:
<div class="message-cell message-cell--user" id="pstgrp-{$post.User.display_style_group_id}">

Now in Extra.less you need to add the follow, you control the colors per group:
C++:
#pstgrp-2 {border-left: 3px solid #FF0000 !important; }
#pstgrp-3 {border-left: 3px solid #FF4500 !important; }
#pstgrp-4 {border-left: 3px solid #00FF99 !important; }

The number identifies the group for anyone that may be confused.
 
Similar threads Most view View more
Back
Top