Building with XenForo 2 is back

Over the next few weeks, we'll be adding to the Building with XenForo 2 video series, starting today with a look at how to make your custom add-on content taggable!


IMG_0200].png
 
Last edited:

XenForo

Company info
Staff member
Today, part 17 looks into building a section within the admin control panel using routes, admin navigation, admin controllers and all the rest...

And then, we build a list of content and implement Filterer to allow the content to be extensively searchable, with tokenised search parameters for users to manipulate.


1656494460242.png
 

asprin

Active member
Wait...is the filterer still not supported for public controllers as mentioned at the end of the video?

But I've seen addons have it on public lists as well :confused:
 

Kier

XenForo developer
Staff member
Wait...is the filterer still not supported for public controllers as mentioned at the end of the video?

But I've seen addons have it on public lists as well :confused:
The filterer can be used for public controllers, but it's very easy to abuse it and cause performance issues for your forum. Consequently, we don't make it readily available on the public side, requiring add-on authors to jump through a few more hoops to make it work.
 

asprin

Active member
Consequently, we don't make it readily available on the public side, requiring add-on authors to jump through a few more hoops to make it work.
Yep, understandable and fair. But since I intend to expose it as part of an addon I'm working on, I'll make an attempt to get it working. I'm hoping I'm able to understand these "hoops" that I need to go through. Don't have any reference per se but keeping my fingers crossed.
 

Kier

XenForo developer
Staff member
Yep, understandable and fair. But since I intend to expose it as part of an addon I'm working on, I'll make an attempt to get it working. I'm hoping I'm able to understand these "hoops" that I need to go through. Don't have any reference per se but keeping my fingers crossed.
All you really need to do is pull the contents of filter_macros::filter_bar through to a public template (or reference it directly), but I'd just caution its use outside of the ACP again - inside the control panel you have a very limited number of users with access to the system, and it's rare that you'd have more than one or two admins using the tool at the same time. On the other hand, letting an potentially large number of visitors access the filterer concurrently could lead to serious performance issues unless you're very careful in selecting how the results can be filtered. If you must do it, make sure that each of the Finder->where() clauses you employ hit an appropriate index in the database or are optimised in some other way.
 

asprin

Active member
Am I right in assuming that the concept of Filterer is not available in XF v2.1?

I didn't want to upgrade yet but I guess if I have to use list filters then I might well have to do it then....
 

Kier

XenForo developer
Staff member
Am I right in assuming that the concept of Filterer is not available in XF v2.1?

I didn't want to upgrade yet but I guess if I have to use list filters then I might well have to do it then....
Correct, Filterer became available in 2.2.something
 
Top