# Topic List Sort By Votes in voting plugin

**URL:** https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281
**Category:** Feature
**Tags:** topic-voting, completed
**Created:** [24 Mayo, 2017 13:29 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281 "2017-05-24T13:29:56Z")
**Posts on this page:** 11
**Page:** 2

<div class="post-metadata">

### Author: ![Kameron\_Bourgeois](https://avatars.discourse-cdn.com/v4/letter/k/779978/32.png) [@Kameron\_Bourgeois](https://meta.discourse.org/u/Kameron_Bourgeois)
#### Post date: [26 Noviembre, 2018 23:28 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/22 "2018-11-26T23:28:12Z")

</div>

Any idea for when the plugin API will offer the functionality to let sorting by votes be included in the plugin?

---

<div class="post-metadata">

### Author: ![CapedCrusader](https://avatars.discourse-cdn.com/v4/letter/c/f04885/32.png) [@CapedCrusader](https://meta.discourse.org/u/CapedCrusader)
#### Post date: [4 Marzo, 2019 17:26 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/23 "2019-03-04T17:26:58Z")

</div>

Hoping “soon” is soon. 😃

---

<div class="post-metadata">

### Author: ![dan](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dan/32/101549_2.png) [@dan](https://meta.discourse.org/u/dan)
#### Post date: [12 Marzo, 2019 23:22 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/24 "2019-03-12T23:22:12Z")

</div>

I have added the required plugin API in [discourse#7158](https://github.com/discourse/discourse/pull/7158) and used it in [discourse-voting#38](https://github.com/discourse/discourse-voting/pull/38).

Sorry for taking me so long. 😢

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [22 Abril, 2019 22:18 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/25 "2019-04-22T22:18:09Z")

</div>

This is awesome, sorting by votes is now an _option_, but is there any way to make it a category default through the plugin per OP?

The [Wyze Wishlist](https://forums.wyzecam.com/c/wishlist) appears to sort by votes by default, but I’ve not had time to dig through their page to see if they’re using another method.

With the voting plugin installed these are the two available options:

 ![09%20PM](https://global.discourse-cdn.com/meta/original/3X/1/1/11c05b600ccec679948ac4f63187224eb27ddb71.png)

Did I miss a step?

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [22 Abril, 2019 22:32 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/26 "2019-04-22T22:32:24Z")

</div>

You can add the option like this

```plaintext
<script type="text/discourse-plugin" version="0.8.25">
  api.modifyClass('component:edit-category-settings', {
    availableViews: Ember.computed(function() {
      let views = this._super();
      let voteView = {};
      voteView["name"] = "Votes";
      voteView["value"] = "votes";
      views.push(voteView);
      return views;
    })
  });
</script>

```

Seems like it would be a nice option to include in the plugin.

---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [22 Abril, 2019 22:46 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/27 "2019-04-22T22:46:26Z")

</div>

Thanks, that gets most of the way.

For some reason items in the extra-nav-item-outlet apply the `active` class to the list item rather than the link, so ‘Votes’ isn’t shown as active. Is that intentional?

I’ve created a CSS workaround for now, styling both `.nav-pills>li.active a` and `.nav-pills>li a.active`.

---

<div class="post-metadata">

### Author: ![tshenry](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tshenry/32/119495_2.png) [@tshenry](https://meta.discourse.org/u/tshenry)
#### Post date: [23 Mayo, 2019 09:36 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/28 "2019-05-23T09:36:35Z")

</div>

A post was split to a new topic: [Topics that were voted on disappear from user profile after being closed](https://meta.discourse.org/t/topics-that-were-voted-on-disappear-from-user-profile-after-being-closed/118492)

---

<div class="post-metadata">

### Author: ![AGEID](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@AGEID](https://meta.discourse.org/u/AGEID)
#### Post date: [14 Junio, 2020 21:47 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/29 "2020-06-14T21:47:11Z")

</div>

Hola Stephen,

¿Podrías ayudarme a explicar dónde debo colocar el código de @awesomerobot para que mis temas se clasifiquen por votos en mi página de estilo de categoría de escritorio “Cajas con temas destacados”?

Muchas gracias,

AGEID

---

<div class="post-metadata">

### Author: ![Luke\_Cousins](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/luke_cousins/32/223644_2.png) [@Luke\_Cousins](https://meta.discourse.org/u/Luke_Cousins)
#### Post date: [21 Octubre, 2022 07:31 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/30 "2022-10-21T07:31:13Z")

</div>

¿También me gustaría ayuda sobre dónde poner ese código, @awesomerobot?

También he notado que si uso la configuración que aparece a continuación, la pestaña “Más reciente” muestra más votos en lugar de lo más reciente y, por lo tanto, no se pueden ver los temas más recientes en absoluto. ¿Es esto un error o algo que estoy haciendo mal?

 ![Screenshot 2022-10-21 at 08.28.14](https://global.discourse-cdn.com/meta/original/4X/7/7/6/7767164128becec663c92dfcc1fcd9a555333d9f.png)

Me gustaría que la categoría, por defecto, se ordenara por votos (desc), y que los usuarios tuvieran la opción de ordenar por lo más reciente si quisieran también. Gracias.

---

<div class="post-metadata">

### Author: ![awesomerobot](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/awesomerobot/32/142900_2.png) [@awesomerobot](https://meta.discourse.org/u/awesomerobot)
#### Post date: [21 Octubre, 2022 14:08 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/31 "2022-10-21T14:08:37Z")

</div>

> [@Luke\_Cousins](#):
>
> ¿Es esto un error o algo que estoy haciendo mal?

No, eso parece estar funcionando según lo previsto, aunque no es la mejor experiencia. Cuando la “ordenación de la lista de temas por” se cambia a Votos, es confuso que todavía se llame “Últimos”.

> [@Luke\_Cousins](#):
>
> ¿También me gustaría ayuda sobre dónde poner ese código, @awesomerobot?

Puedes ponerlo en la sección `Head` de tu tema, en administración → personalizar → temas.

---

<div class="post-metadata">

### Author: ![chapoi](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/chapoi/32/537252_2.png) [@chapoi](https://meta.discourse.org/u/chapoi)
#### Post date: [2 Diciembre, 2025 14:46 UTC](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281/32 "2025-12-02T14:46:59Z")

</div>



[Previous page](https://meta.discourse.org/t/topic-list-sort-by-votes-in-voting-plugin/63281.md?page=1)
