xF2 Template Modification How to thread post border frame color by user group?

lazarote

web enthusiastic
Collaborate
Registered
Joined
Jun 24, 2019
Messages
142
Points
53

Reputation:

@Zer01ne @Kenpachi @thomsa @Cwadel


Step1:

Create a new template , for example post_highlight

put this code inside the template:

Code:
<xf:if is="(in_array(6, {$post.User.user_group_id}) OR in_array(6, {$post.User.secondary_group_ids}))">vip_highlight</xf:if>

remember to change the group 6 for the one you want, if you want several usergroups just add more to IF

now go to your post_macros template and find line 19 (vanilla xenforo)

replace this:

<div class="message-inner">

with

<div class="message-inner <xf:include template="post_highlight"/> ">

and now add to your extra. Less template

CSS:
.vip_highlight {
  border: 3px solid; /* Establece el tamaño del borde y elimina el color */
  animation: border-animation 5s linear infinite; /* Agrega la animación */
}
 
Last edited:

Sagex

Well-known member
Registered
Joined
Sep 10, 2021
Messages
59
Points
28

Reputation:

@Zer01ne @Kenpachi @thomsa @Cwadel


Step1:

Create a new template , for example post_highlight

put this code inside the template:

Code:
<xf:if is="(in_array(6, {$post.User.user_group_id}) OR in_array(6, {$post.User.secondary_group_ids}))">vip_highlight</xf:if>

remember to change the group 6 for the one you want, if you want several usergroups just add more to IF

now go to your post_macros template and find line 19 (vanilla xenforo)

replace this:



with



and now add to your extra. Less template

CSS:
.vip_highlight {
  border: 3px solid; /* Establece el tamaño del borde y elimina el color */
  animation: border-animation 5s linear infinite; /* Agrega la animación */
}
lazaroteThe code -
<div class="message-inner <xf:include template="post_highlight"/> ">
Might be a little bit broken
 
View previous replies…

XenFrodo

Well-known member
Registered
Joined
Dec 28, 2023
Messages
75
Points
18

Reputation:

The code -
<div class="message-inner <xf:include template="post_highlight"/> ">
Might be a little bit broken
SagexIn my case not only the border is colored but also the complete text of the post. How can I separate the Border / Text?
Only the Border color would be Nice

@lazarote do have a fix for my problem and maybe a clean code now?

Xf 2.2.15

FAIL.jpg
 
Last edited:

Snister2

Active member
Registered
Joined
Jan 6, 2023
Messages
36
Points
18

Reputation:

In my case not only the border is colored but also the complete text of the post. How can I separate the Border / Text?
Only the Border color would be Nice

@lazarote do have a fix for my problem and maybe a clean code now?

Xf 2.2.15

View attachment 39354
XenFrodojust modify inside on innder

CSS:
.message-inner {


    border-right: 1px solid #fff;
    border-left: 1px solid #fff;
    border-bottom: 1px solid #fff;
    border-top: 1px solid #fff;


}

take note just add a border do not remove the existing style code on message-inner class
 

XenFrodo

Well-known member
Registered
Joined
Dec 28, 2023
Messages
75
Points
18

Reputation:

just modify inside on innder

CSS:
.message-inner {


    border-right: 1px solid #fff;
    border-left: 1px solid #fff;
    border-bottom: 1px solid #fff;
    border-top: 1px solid #fff;


}

take note just add a border do not remove the existing style code on message-inner class
Snister2i try it later thank you for the fast answer. i let you guys know how it goes
 

Snister2

Active member
Registered
Joined
Jan 6, 2023
Messages
36
Points
18

Reputation:

try this

CSS:
.message-inner {
    border-right: 1px solid #fff;
    border-left: 1px solid #fff;
    border-bottom: 1px solid #fff;
    border-top: 1px solid #fff;
}
 

XenFrodo

Well-known member
Registered
Joined
Dec 28, 2023
Messages
75
Points
18

Reputation:

try this

CSS:
.message-inner {
    border-right: 1px solid #fff;
    border-left: 1px solid #fff;
    border-bottom: 1px solid #fff;
    border-top: 1px solid #fff;
}
Snister2This adds a border everywhere and it is always the same color how would the code look exactly if you want to set it individually for user groups where exactly you add which code?
 

Snister2

Active member
Registered
Joined
Jan 6, 2023
Messages
36
Points
18

Reputation:

This adds a border everywhere and it is always the same color how would the code look exactly if you want to set it individually for user groups where exactly you add which code?
XenFrodoActually I'm new to xenforo only a month but I tried to learn, so not very good yet.
try this code
CSS:
<xf:if is="{{$user.isMemberOf(3)}}">
    <xf:css src="border1.less" />
        <xf:elseif is="{{$user.isMemberOf(4)}}"/>
        <xf:css src="border2.less" />
            <xf:elseif is="{{$user.isMemberOf(6)}}"/>
            <xf:css src="border3.less" />
        </xf:if>

this code was working 100% if you got
 
Last edited:
Top