XF 2.4 Custom Field Improvements: Filtering and more!

With XenForo 2.4 we are finally addressing one of the most common pieces of feedback we get regarding custom fields which is filtering! But first, let's take a little look under the hood to see what else is new:

Flexible custom field types​

Each of the existing custom field types are now moved to their own individual handler classes and assigned to add-ons in the database. This opens the door for developers to finally introduce their own custom field types for their add-ons. So instead of being constrained to the defaults we provide, developers will be able to add all sorts of custom fields, each with different display and filtering options. Previously this was at best "tricky" to do in XenForo 2.3 but now any conceivable custom field type should be possible.

The flow for adding a new custom field is slightly different as you now start by picking the specific custom field type you are adding first. This is where you would see custom types too:

1770393136279.webp


After selecting your custom field type, the process for creating that field will be familiar.

But let's take a look at the real reason you're probably here - filtering!

Custom field filtering​

When adding a custom field you can now, under "General options", toggle whether the field can be used for filtering. When enabled, the Filters menu on the thread list will now display filters for the filterable fields, alongside the typical filter options:

1770393993175.webp


Once you populate your criteria and click filter, only threads matching those filters will be returned:

1770394141343.webp


Coming soon...?​

There are some logical progressions from this including, but not limited to, more default custom field types and custom field searching but, while we cannot commit to anything today, I will just say it is something we're looking into :)
 
For users too! Admins and users have wanted filtering for years. Being more flexible with field types is more for developers (and ourselves) but also good for users in the long run.
Tangentially related; Any chance of moving the admin:filter_macros::filter_bar to the front-end? The new Filterer system you added in 2.3 is great, but it's effectively admin-only (without copying that entire macro into a custom template) as a result of that one macro being inaccessible to the front-end.

That would be the perfect companion to this system, I'd say ;)
 
Will this allow filtering by multi-select (ie value A+value B from the same field) without doing something like a FIND_IN_SET which is scanning an unbound number of thread rows?

And does that mean filtering by tags will be something XF will be looking into?
 
Will this allow filtering by multi-select (ie value A+value B from the same field) without doing something like a FIND_IN_SET which is scanning an unbound number of thread rows?

And does that mean filtering by tags will be something XF will be looking into?
We store field values in a separate index table so this shouldn't be an issue.
 
Thanks for sharing these exciting updates on XenForo 2.4! The flexible custom field types and filtering options sound like a game-changer for developers—finally, we can innovate with new field types without hacks. As someone maintaining a portfolio of add-ons, this opens up so many possibilities. Can't wait to dive in and see what the team has in store for the full release. Great work, and welcome to the future of customization!
 
There doesn’t feel like there’s a reasonable use case for profile fields just yet. At least not for common use cases. Though an add-on could easily implement user filtering with field filtering. It’s the same system but because we don’t have a concept of filtering users or even displaying a full list of users by default it’s not that relevant. But yes possible with further development.
 
Custom profile field filtering would make sense for big boards with fragmented audience. For example if part of the members are developers, then a filter on a custom field for that would be useful. Custom fields can be useful in any content type. I would use it in resources, media and major addons.

One thing that will be requested by many is live filtering. I hope you will find time for that.
 
Awesome!!!

Just wonder how the Filter dro-down box will manage displaying a ton of custom filter options for mad-lad admins. XD Hardly very important though regardless.
 
Back
Top Bottom