Can I assign a user-specific title / banner?

PatriotGB

Well-known member
Is there a way that I (admin) can create a user title (in a banner) for just one user?
So, for example... a member that made the 20,000th post. I'd like to put a banner in his panel, with the other banners, sort of like an "award."

Thanks!
 
It would be ideal to have an integrated solution in xenforo like: "if so... add or do this...." in short, dynamic tasks without necessarily creating specific groups.
 
You can create another user group, add a banner for that group and put that user in the specified user group.

I thought of that, but then I could end up with a whole bunch of user groups.

I just wanted to be able to create a single "fun" banner for an individual user as a "reward."
 
This inspired me an add-on:

Tried to download but I get directed to a French website where it appears I have to register. I took two years of French in high school a LONG time ago. LOL! But I don't speak French.
 
@PatriotGB: i have good news for you.
If you want to be able to place a banner under any username you can use custom user fields:
  • Creates a custom profile field named Banner, not editable by the user. A simple text field with userBanner as ID for example.
  • In message_macros template find :
    • <xf:userbanners user="$user" tag="div" class="message-userBanner" itemprop="jobTitle" />
    • add under :
    • {$user.Profile.custom_fields.userBanner}
  • Now in admin CP for each user you have a field named Banner, the text you will fill in for each user will be displayed under his username.
You can set a class to format the text as a banner.
Easy !
 
@PatriotGB: i have good news for you.
If you want to be able to place a banner under any username you can use custom user fields:
  • Creates a custom profile field named Banner, not editable by the user. A simple text field with userBanner as ID for example.
  • In message_macros template find :
    • <xf:userbanners user="$user" tag="div" class="message-userBanner" itemprop="jobTitle" />
    • add under :
    • {$user.Profile.custom_fields.userBanner}
  • Now in admin CP for each user you have a field named Banner, the text you will fill in for each user will be displayed under his username.
You can set a class to format the text as a banner.
Easy !

That's "Chinese" to me. I have to admit having no clue as to where or how I would do that. I don't know what any of it means. I'm not a coder.
 
  • Creates a custom profile field named Banner, not editable by the user. A simple text field with userBanner as ID for example.
  • In message_macros template find :
    • <xf:userbanners user="$user" tag="div" class="message-userBanner" itemprop="jobTitle" />
    • add under :
    • {$user.Profile.custom_fields.userBanner}
  • Now in admin CP for each user you have a field named Banner, the text you will fill in for each user will be displayed under his username.
You can set a class to format the text as a banner.
Easy !

OK... found it. But I'm not sure what "add under :" is referring to.

1672442177854.png

Also don't know what this means:
You can set a class to format the text as a banner.
 
You got this
HTML:
<div class="message-userDetails">
    <h4 class="message-name"><xf:username user="$user" rich="true" defaultname="{$fallbackName}" itemprop="name" /></h4>
    <xf:usertitle user="$user" tag="h5" class="message-userTitle" banner="true" itemprop="jobTitle" />
    <xf:userbanners user="$user" tag="div" class="message-userBanner" itemprop="jobTitle" />
</div>
After adding the code you got this
HTML:
<div class="message-userDetails">
    <h4 class="message-name"><xf:username user="$user" rich="true" defaultname="{$fallbackName}" itemprop="name" /></h4>
    <xf:usertitle user="$user" tag="h5" class="message-userTitle" banner="true" itemprop="jobTitle" />
    <xf:userbanners user="$user" tag="div" class="message-userBanner" itemprop="jobTitle" />
    {$user.Profile.custom_fields.userBanner}
</div>
I should have used below rather than under but it's due to my bad English, sorry.

Also don't know what this means:
The code above will display the text you filled in but without layout.
If you want you can use the core label system:
<span class="label label--primary">{$user.Profile.custom_fields.userBanner}</span>
or
<span class="label label--accent">{$user.Profile.custom_fields.userBanner}</span>
or
<span class="label label--lightGreen">{$user.Profile.custom_fields.userBanner}</span>
or
<span class="label label--yellow">{$user.Profile.custom_fields.userBanner}</span>
etc...

HTML:
<div class="message-userDetails">
    <h4 class="message-name"><xf:username user="$user" rich="true" defaultname="{$fallbackName}" itemprop="name" /></h4>
    <xf:usertitle user="$user" tag="h5" class="message-userTitle" banner="true" itemprop="jobTitle" />
    <xf:userbanners user="$user" tag="div" class="message-userBanner" itemprop="jobTitle" />
    <span class="label label--primary">{$user.Profile.custom_fields.userBanner}</span>
</div>

Or use your own class:
<span class="myClass">{$user.Profile.custom_fields.userBanner}</span>

and set this class in extra.less template.
Less:
.myClass {
    border: 1px solid red;
    color: red;
    background: #FAFAFA;
    border-radius: 4px
}
 
OK... cool. Done. But I don't see the "Banner" field on the user page in the ACP.

Here's what I did:
1672511047499.webp

Thanks for your help! C'est tres bon! (That's as good as I get with French, 43 years after taking it in school!)
 
OK... figured that out.

1672548758670.png

But it's not showing on the user's box to the left of the posts (forget what that's called).

Wait... here it is:

I thought it was going to show up as a banner (blue arrow) rather than as a stat below.
1672549071942.png

Your add-on does what I wanted (though limited to 5) by putting the text in a colored banner. I thought maybe this was a way to do the same thing natively.
 
Last edited:
I should have used below rather than under but it's due to my bad English, sorry.
No need to apologize... a more experienced admin would know what you were talking about. The issue is as we get more experience, we tend to forget that others aren't as "progressed" as we are.... so we tend to reflect the data points in a manner that we are familiar with.

We simply need to remember to (and I KNOW this sounds bad) "dumb" it down to a beginner level frequently. And I am REGULARLY guilty of this.
 
Top Bottom