In the discussion titled “Sort by likes in 2.5.0.beta6,” user jabeler reports that a previously working method to sort topics by likes in 2.5.0.beta6 is no longer functional, citing a TypeError. tshenry suggests an updated approach using modern Discourse plugin patterns, providing a code snippet to implement a “Top Liked” filter. jabeler confirms the new method works successfully.
Previously, we were using @sam’s suggestion to provide an option to sort topics in a category by likes, but as of 2.5.0.beta6 this appears to no longer be working.
TypeError: undefined is not an object (evaluating 'Discourse.SiteSettings.top_menu = 'categories|latest|top|new|unread'')
Is there a new method to enable this functionality?
Hmm, I didn’t immediately run into the same error when trying it out. With that said, the code you linked to is quite old these days! I think this should cover most of the modern patterns and achieve the same (or better) result. Can you give it a try, of course with values that make sense for your community?