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

Kenpachi

SVIP Member
S.V.I.P Member
Registered
Joined
Oct 1, 2019
Messages
130
Points
53

Reputation:

Hi community!

What modification or addons need for get this modification?

border frame.JPG
 

Cwadel

SVIP Member
S.V.I.P Member
Registered
Joined
Feb 3, 2023
Messages
15
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
196
Points
43

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

SVIP Member
S.V.I.P Member
Registered
Joined
Feb 3, 2023
Messages
15
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
935
Points
153

Reputation:

Zer01ne

Collaborate
Collaborate
Registered
Joined
Nov 25, 2022
Messages
196
Points
43

Reputation:

Kenpachi

SVIP Member
S.V.I.P Member
Registered
Joined
Oct 1, 2019
Messages
130
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
Registered
Joined
Jun 24, 2019
Messages
127
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
196
Points
43

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
 
Top