XF 2.3 Custom User Field in User Banner section?

ArtG

Active member
I have a custom user field that shows up like a banner in the user message info section. You can see how I do this here:


Unfortunately, it seems Xenforo doesn't show that section on mobile so anyone using my site on mobile doesn't see it. I'm trying to fix that.

Is there a way to move a custom user field to the section that has user banners so that it does show on mobile?

Thanks
 
Solution
You can't directly target the specific elements by name, but once you have redisplayed .message-userExtras you can hide specific elements, e.g. to hide the second one

Code:
.message-userExtras dl:nth-child(2)
{display:none}

EDIT: I just realised the above will hide the elements on desktop also so you need something like this to hide the first 2 on mobile (change nth number to suit)

Code:
@media (max-width: @xf-responsiveNarrow)
{
.message-userExtras dl:nth-child(1),.message-userExtras dl:nth-child(2)
{display:none}
}



See more on nth child:

You can't directly target the specific elements by name, but once you have redisplayed .message-userExtras you can hide specific elements, e.g. to hide the second one

Code:
.message-userExtras dl:nth-child(2)
{display:none}

EDIT: I just realised the above will hide the elements on desktop also so you need something like this to hide the first 2 on mobile (change nth number to suit)

Code:
@media (max-width: @xf-responsiveNarrow)
{
.message-userExtras dl:nth-child(1),.message-userExtras dl:nth-child(2)
{display:none}
}



See more on nth child:

 
Last edited:
Solution
Back
Top Bottom