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

Kenpachi

Well-known member
Registered
Joined
Oct 1, 2019
Messages
169
Points
53

Reputation:

Hi community!

What modification or addons need for get this modification?

border frame.JPG
 

Cwadel

Member
Registered
Joined
Feb 3, 2023
Messages
16
Points
3

Reputation:

hi

try this : add in your style extra.less


Code:
.block--messages .message, .block--messages .block-row {
    color: #fdfdfd;
    background: #181818;
    border-width: 1px;
    border-style: solid;
    border-top-color: #be2525;
    border-right-color: #d92121;
    border-bottom-color: #c91f1f;
    border-left-color: #ce2d2d;
    border-radius: 4px;
}

edit this to change color :

CSS:
border-top-color: ;

 border-right-color: ;

 border-bottom-color: ;

 border-left-color: ;

change the color like you want :)
 

Zer01ne

Collaborate
Collaborate
Registered
Joined
Nov 25, 2022
Messages
665
Points
253

Reputation:

hi

try this : add in your style extra.less


Code:
.block--messages .message, .block--messages .block-row {
    color: #fdfdfd;
    background: #181818;
    border-width: 1px;
    border-style: solid;
    border-top-color: #be2525;
    border-right-color: #d92121;
    border-bottom-color: #c91f1f;
    border-left-color: #ce2d2d;
    border-radius: 4px;
}

edit this to change color :

CSS:
border-top-color: ;

 border-right-color: ;

 border-bottom-color: ;

 border-left-color: ;

change the color like you want :)
CwadelI think you missed the title
it is based on user groups.
For example admin block will be red.
registered members block will be green.
 

Cwadel

Member
Registered
Joined
Feb 3, 2023
Messages
16
Points
3

Reputation:

I think you missed the title
it is based on user groups.
For example admin block will be red.
registered members block will be green.
Zer01neto my knowledge, we can't target groups in css, You mut use conditional statements in the concerned template.
 

thomsa

Moderator
Staff member
Moderator
S.V.I.P Member
Collaborate
Registered
Joined
Jun 22, 2019
Messages
1,066
Points
173

Reputation:

Zer01ne

Collaborate
Collaborate
Registered
Joined
Nov 25, 2022
Messages
665
Points
253

Reputation:

Kenpachi

Well-known member
Registered
Joined
Oct 1, 2019
Messages
169
Points
53

Reputation:

Thanks to all for the help, I was able to do it thanks an user who help me. My idea was make border by user group like admin and mod only.
 

lazarote

web enthusiastic
Collaborate
Registered
Joined
Jun 24, 2019
Messages
141
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:

Zer01ne

Collaborate
Collaborate
Registered
Joined
Nov 25, 2022
Messages
665
Points
253

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 */
}
lazaroteThanks a lot for this documentation
 

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…

Snister2

Active member
Registered
Joined
Jan 6, 2023
Messages
33
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

SVIP Member
S.V.I.P Member
Registered
Joined
Dec 28, 2023
Messages
61
Points
8

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
 

ForumFlake

Well-known member
Registered
Joined
Feb 8, 2023
Messages
79
Points
8

Reputation:

How can I get that exact postbit? What would be the css coding and the post macros.
 

Zer01ne

Collaborate
Collaborate
Registered
Joined
Nov 25, 2022
Messages
665
Points
253

Reputation:

View previous replies…

Zer01ne

Collaborate
Collaborate
Registered
Joined
Nov 25, 2022
Messages
665
Points
253

Reputation:

That was the wrong reply that's why I edited the comment.
 

ForumFlake

Well-known member
Registered
Joined
Feb 8, 2023
Messages
79
Points
8

Reputation:

Darn alright. I know there is a theme that has that coding but I dont wanna copy it and screw something up. its the sojija theme or something like that.
 
Top