# Een icoon toevoegen voor wiki's in de onderwerplijst?

**URL:** https://meta.discourse.org/t/add-an-icon-in-front-of-wikis-in-the-topic-list/206888
**Category:** Development
**Created:** [24 oktober 2021 om 10:05 UTC](https://meta.discourse.org/t/add-an-icon-in-front-of-wikis-in-the-topic-list/206888 "2021-10-24T10:05:38Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [24 oktober 2021 om 10:05 UTC](https://meta.discourse.org/t/add-an-icon-in-front-of-wikis-in-the-topic-list/206888/1 "2021-10-24T10:05:38Z")

</div>

There is no specific CSS class in the topic list.  
Is it possible by editing the topic list template?

---

<div class="post-metadata">

### Author: ![Johani](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/johani/32/176920_2.png) [@Johani](https://meta.discourse.org/u/Johani)
#### Post date: [24 oktober 2021 om 13:38 UTC](https://meta.discourse.org/t/add-an-icon-in-front-of-wikis-in-the-topic-list/206888/2 "2021-10-24T13:38:33Z")

</div>

If you only want to add a class to the topic list item component, you can do that without modifying the template. You can use something like this.

```javascript
const discourseComputed = require("discourse-common/utils/decorators").default;

api.modifyClass("component:topic-list-item", {
  pluginId: "add-views-class",
  @discourseComputed()
  unboundClassNames() {
    // log the topic properties to see what you have to work with
    console.log(this.topic);
    // inherit the default classes from core and plugins
    let classList = this._super(...arguments);
    // add your new classes based on a property
    if (this.topic.views > 100) {
      classList += " has-many-views";
    }
    // return the modified classList
    return classList;
  }
});

```

Then a bit of CSS

```css
.has-many-views {
  background: red;
}

```

Unfortunately, wiki is a post-level, not a topic-level property. So, It’s not added to the topic list item model. You can use a tag or create a feature request for Discourse to add that class.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [23 november 2021 om 13:39 UTC](https://meta.discourse.org/t/add-an-icon-in-front-of-wikis-in-the-topic-list/206888/3 "2021-11-23T13:39:11Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
