We’re excited to have you join us! By registering, you’ll gain access to exclusive content, including leaked files and nulled software. Engage with our community, share your insights, and stay updated on the latest releases.

Get ready to explore and enjoy all the benefits of being a member, and feel free to connect with others through discussions and private messages.

Warning: Please do not create multiple accounts. We have a system in place that detects multiple account registrations, and any violations may result in a permanent ban.

Sign Up Now and Start Exploring!
  • License distribution for the
    Ibo 3.9 app+ panel with 17 themes to choose
    is now available for free, we are decrypting it now
    Only for VIP memberships

XenForo Customising the layout with custom user fields

El Bana

Active member
Registered
Joined
Jul 25, 2024
Messages
142
This is a simple guide explaining how custom user fields can be used to customise the layout and allow members to have some form of control over the content, depending on the options you provide.

For the purposes of this guide, we will be creating a checkbox for members to opt out of seeing the forum statistics in the sidebar.

Create the custom user field
The first step is to create the custom user field, like so:

1722521828472.png


A new option will then be present on the account preferences page.



1722521841358.png
Edit the widget

Now we enter a conditional statement in the widget display condition field to show the widget when the field is unchecked.
The code for that is:



PHP:
Please, Log in or Register to view codes content!


1722521862513.png


Note how removeStatistics matches the ID of the custom user field.

That's it!
  • Any member who now checks the field in their preferences will no longer see the widget in the sidebar.
  • The same approach can be used for templates, forums, etc.
  • Just use the custom user field ID with a conditional statement to show/hide content.
 
Back
Top