Resource icon

xF2 Template Modification User Message Background

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
19,760
Points
823

Reputation:

ENXF NET submitted a new resource:

User Message Background - Set the message background for a specific user

Add to extra.less
Code:
.message-background (@mbUserName; @mbBackgroundUrl; @mbBackground-size; @mbBackground-position: false) {
 
  .message[data-author="@{mbUserName}"] .message-inner {
    background-image: linear-gradient(to top, @xf-contentBg, fade(@xf-contentBg, 60%)), @mbBackgroundUrl;
  background-position: @mbBackground-position;
  background-size: @mbBackground-size;
}
.message[data-author="@{mbUserName}"] .message-cell.message-cell--user {
   background: transparent;
}
}
//...

Read more about this resource...
 

Pr0fesseur

Moderator
Staff member
Moderator
+Lifetime VIP+
V.I.P Member
Collaborate
Registered
Joined
Nov 20, 2019
Messages
361
Points
103

Reputation:

how would i make this a dragonbyte shop/unlockable item?
 

DaRKeN

Member
Registered
Joined
Oct 22, 2021
Messages
6
Points
3

Reputation:

What would be the variable to call the user's banner and be able to use it as a background?

Thank you.
 

lazarote

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

Reputation:

View previous replies…

one_finger_man

Well-known member
Registered
Joined
Jan 20, 2022
Messages
383
Points
53

Reputation:

it this the only code it not working there should be a post_macros section or im not seeing it
 

one_finger_man

Well-known member
Registered
Joined
Jan 20, 2022
Messages
383
Points
53

Reputation:

i am posting an update to for this that you need to make this work!!!!

HTML:
.msgBgById (@msgBgAuthorId; @msgBgUrl; @msgBgSize; @msgBgPosition: false) {
 
  .message[data-author-id="@{msgBgAuthorId}"] .message-inner {
    background-image: linear-gradient(to top, @xf-contentBg, fade(@xf-contentBg, 60%)), url(@msgBgUrl);
  background-position: @msgBgPosition;
  background-size: @msgBgSize;
}
.message[data-author-id="@{msgBgAuthorId}"] .message-cell.message-cell--user {
   background: transparent;
}
}
// Example
.msgBgById (1; 'https://i.imgur.com/W1yqxKS.jpg'; cover; left);

change image to what you like!

First, create a template modification

Template: post_macros
Modification key: messageAuthorId

Find:

HTML:
data-author="{{ $post.User.username ?: $post.username }}"

replace with:

HTML:
$0
data-author-id="{{ $post.User.user_id ?: 0}}"

i add the image so you know that it works

-1-test-topic-.jpg
 
Last edited:

Karat-7

New member
Registered
Joined
May 14, 2021
Messages
4
Points
11

Reputation:

i am posting an update to for this that you need to make this work!!!!

HTML:
.msgBgById (@msgBgAuthorId; @msgBgUrl; @msgBgSize; @msgBgPosition: false) {
 
  .message[data-author-id="@{msgBgAuthorId}"] .message-inner {
    background-image: linear-gradient(to top, @xf-contentBg, fade(@xf-contentBg, 60%)), url(@msgBgUrl);
  background-position: @msgBgPosition;
  background-size: @msgBgSize;
}
.message[data-author-id="@{msgBgAuthorId}"] .message-cell.message-cell--user {
   background: transparent;
}
}
// Example
.msgBgById (1; 'https://i.imgur.com/W1yqxKS.jpg'; cover; left);

change image to what you like!

First, create a template modification

Template: post_macros
Modification key: messageAuthorId

Find:

HTML:
data-author="{{ $post.User.username ?: $post.username }}"

replace with:

HTML:
$0
data-author-id="{{ $post.User.user_id ?: 0}}"

i add the image so you know that it works

View attachment 30672
one_finger_manCan add blur behind text
CSS:
.message[data-author-id="1"] .bbWrapper {
    font-weight: 500;
    backdrop-filter: blur(2px);
    padding: 3px;
}

Here is the user id
CSS:
.message[data-author-id="1"]
 
Top