1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Custom user fields

Discussion in 'Styling and Customization Questions' started by korhox, Jun 4, 2016.

  1. korhox

    korhox Member

    Hi! I'm trying to add background image behind avatar holder in message user info like this:
    ^ Sorry for Finnish language in image
    .messageUserBlock div.avatarHolder {
        padding: 25px !important;
        background-image: url("/styles/mystyle/avatarholderbackgrounds/default.png");
        background-size: cover;
    <div class="avatarHolder">
                <span class="helper"></span>
                <xen:avatar user="$user" size="m" img="true" />
                <xen:if is="{$user.isOnline}"><span class="Tooltip onlineMarker" title="{xen:phrase online_now}" data-offsetX="-22" data-offsetY="-8"></span></xen:if>
                <!-- slot: message_user_info_avatar -->
    So, my question is:
    How I can add different avatarHolder background for everyone? Users can select their background with custom user fields (radio buttons).

    Sorry poor English language skills. I hope you realize what I mean :D
  2. Mike

    Mike XenForo Developer Staff Member

    You'd probably want to make the "IDs" of the radio field represent class names (or class suffixes). Then you'd add an extra class name to the avatarHolder div based on that value. Your custom CSS would just override the image based on that (.messageUserBlock div.avatarHolder.customFieldClassName).

Share This Page