Récupérer des sujets basés sur un champ personnalisé ?

Hi @angus. The goal is not to add a query on the side search bar (that would be nice, but not the goal here). The goal is to programmatically load topics based on a custom field into a topic-list when the user visits a page. I think I’ve figured out the template/component (ie, view) piece. Now trying to figure out the logic that will load the topics.

The reason for talking about search was my thought that running ajax("/search") for custom_field=value when you visit the page might be a clean way of loading the topics. But I’m just trying to figure out a way that works best.


More details:

In my case, the first goal is to have the user go to a new template page I have created at a new path (/fun_levels/:fun_level), and load all topics with the custom field fun_level matching :fun_level.

I have separately figured out how to create the template and load it at the path. Now I want to programmatically load in the matching topics into the topic-list component I have on the page.

Ideally, I’d avoid having to create a new “fun_level” model (which i have not done yet), just to keep things more straightforward and faster to implement. But I am open to that if inevitably that will be significantly more performant (this is a page that will be used a lot).


How to add the ability to have “fun_level” be an option on the search sidebar would be good to know too–as I’d expect to like to have that too. And maybe the best way to load topics based on the custom field is to add the custom field to the search options, and then call ajax("/search") with the query being “fun_level: super-duper-fun”.

So the search stuff could be important here. But the primary job right now is to load topics on a page based on a custom field when the user visits that page.