Sort by Solved/Unsolved Questions in Category

You can do something like that under Theme > Common (or Desktop, or Mobile, it’s your choise) > Body

<script>
  Discourse.ExternalNavItem = Discourse.NavItem.extend({
    href : function() {
      return this.get('href');
    }.property('href')
  });

  I18n.translations.en.js.filters.solved = { title: "Solved", help: "topics with solution" };
  I18n.translations.en.js.filters.unsolved = { title: "Unsolved", help: "topics without solution" };
  
  Discourse.NavItem.reopenClass({
    buildList : function(category, args) {
      var list = this._super(category, args);

      if(!category) {
        list.push(Discourse.ExternalNavItem.create({href: 'http://your-domain-url/?solved=yes', name: 'solved'}));
        list.push(Discourse.ExternalNavItem.create({href: 'http://your-domain-url/?solved=no', name: 'unsolved'}));
        
        
      }
      return list;
    }
  });
</script>

In this way you add the buttons Solved and Unsolved on your menu.
You need only to change the URLs with your domain (and customize with a particular category if you want, eg http://your-domain-url/c/support?solved=yes)

5 Likes