User Message Background

User Message Background

First, create a template modification

Template: post_macros
Modification key: messageAuthorId
Find:

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


Replace:


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

Then add the code below to extra.less


Less:
.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);
Zurück
Oben