# Get excerpt for regular topics

**URL:** https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482
**Category:** Support
**Created:** [September 19, 2015, 10:05pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482 "2015-09-19T22:05:39Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![michael\_solomon](https://avatars.discourse-cdn.com/v4/letter/m/b19c9b/32.png) [@michael\_solomon](https://meta.discourse.org/u/michael_solomon)
#### Post date: [September 19, 2015, 10:05pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/1 "2015-09-19T22:05:39Z")

</div>

Hi,  
I’m using Discourse API for get the latest topics for specific category(works great!):

```
http://haxe.org.il/c/15/l/latest.json?

```

but I want to get excerpt for all topics not just topics…  
How can I do that?  
Thanks,  
Michael

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [September 19, 2015, 10:57pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/2 "2015-09-19T22:57:29Z")

</div>

> [@michael\_solomon](#):
>
> but I want to get excerpt for all topics not just topics…How can I do that?

There currently isn’t a get parameter to request excerpts, but it’s on the list of feature requests.

---

<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: [January 1, 2018, 4:18pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/4 "2018-01-01T16:18:35Z")

</div>

Hi.  
It has been a few years, is it still impossible to do? I’m looking to display my lastest Discourse posts on a WP site and that would be an excellent feature.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [January 1, 2018, 10:04pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/5 "2018-01-01T22:04:14Z")

</div>

Yeah this exists if you install this plugin:

> [@Discourse Tooltips](https://meta.discourse.org/t/discourse-tooltips-preview-topic-contents-on-hover/69304):
>
> discourse2Summary Discourse Tooltips allows for the previewing of the contents of topics on hover.hammer_and_wrenchRepository Link [https://github.com/discourse/discourse-tooltips](https://github.com/discourse/discourse-tooltips)open_bookInstall Guide [How to install plugins in Discourse](https://meta.discourse.org/t/install-plugins-in-discourse/19157)Features In the future the plugin will show more tooltips but this seemed like a good start slight_smile Last edited by @JammyDodger 2024-06-03T22:01:04Z (UTC) play_button Check document

Per:

[https://github.com/discourse/discourse-tooltips/blob/master/app/controllers/discourse\_tooltips/tooltip\_previews\_controller.rb](https://github.com/discourse/discourse-tooltips/blob/master/app/controllers/discourse_tooltips/tooltip_previews_controller.rb)

@codinghorror I wonder should we just roll in the functionality of discourse tooltip, it will help keep it more stable over time and helps a tiny bit in some desktop situations.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [January 1, 2018, 10:51pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/6 "2018-01-01T22:51:43Z")

</div>

I am fairly strongly opposed, because hover means nothing on touch and we should not be relying on non-touch behaviors at all. And given that the world will be 99.9% smartphone usage soon.. it’s backwards thinking.

---

<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: [January 1, 2018, 11:37pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/7 "2018-01-01T23:37:30Z")

</div>

Hi,  
I’ve installed and enabled this plugin. It works but I still don’t have the excerpts from other topics than pinned in top.json data.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [January 1, 2018, 11:43pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/8 "2018-01-01T23:43:28Z")

</div>

I believe you need to do another request for the excerpts, like:

> <https://github.com/discourse/discourse-tooltips/blob/34e3ed2086f69df181cdb7868869ea44a6c7a1f0/assets/javascripts/mixins/topic-hover-extension.js.es6#L74>

---

<div class="post-metadata">

### Author: ![Carlo](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/carlo/32/79036_2.png) [@Carlo](https://meta.discourse.org/u/Carlo)
#### Post date: [February 19, 2018, 10:02am UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/9 "2018-02-19T10:02:56Z")

</div>

Hi, I know this is an old topic, but I am having the same issue.

My rss feed is working fine, but I rather use the Json one as it is more flexible.

So I have a php plugin that pulls discourse json feed ( latest, top, etc), everything works fine… _expect the excerpt_

Is there is reason why there is no post description on the Json feed? How can I fix this ?

Thanks.

---

<div class="post-metadata">

### Author: ![zcuric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zcuric/32/292837_2.png) [@zcuric](https://meta.discourse.org/u/zcuric)
#### Post date: [April 14, 2020, 1:58pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/10 "2020-04-14T13:58:47Z")

</div>

Hi, I had the same problem and managed to do it by fetching topic again to get needed data. I did that in `topic-list-item.js` component, by using `Ember.PromiseProxyMixin`. How to use it, read here: [Use Ember.PromiseProxyMixin in a theme](https://meta.discourse.org/t/using-ember-promiseproxymixin-in-discourse-development/147231)

Code looks like something like this:

```js
// I've used custom memoize function, to lower the number of requests
const getTopic = memoize(id => ajax(`/t/${id}.json`).then(data => data));
// ...
// Inside of component

  @discourseComputed("topic")
  topicPromise(topic) {
    return getTopic(topic.id);
  },

  @discourseComputed("topicPromise")
  topicProxy() {
    const promise = this.get("topicPromise");
    return promise && PromiseObject.create({ promise });
  },

  postStream: reads("topicProxy.content.post_stream"),

  @discourseComputed("postStream")
  excerpt(postStream) {
    if (!this.get("postStream")) return false;
    return `${stripHtml(postStream.posts[0].cooked).slice(0, 150)}...`;
  },

```

`stripHtml` is custom function to remove html from first post.

In `topic-list-item.hbs` you would have

```handlebars
  {{#if topicProxy.isFulfilled}}
    <div class="excerpt">
      {{#if excerpt}}
        {{html-safe excerpt}}
      {{/if}} 
    </div>
  {{/if}}

```

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 14, 2020, 3:22pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/11 "2020-04-14T15:22:17Z")

</div>

Are you making an extra request for each topic in the list to fetch the excerpt?

---

<div class="post-metadata">

### Author: ![zcuric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zcuric/32/292837_2.png) [@zcuric](https://meta.discourse.org/u/zcuric)
#### Post date: [April 14, 2020, 3:35pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/12 "2020-04-14T15:35:54Z")

</div>

Unfortunately, yes. I know that’s hit on performance, but I don’t make the decisions, if you know what I mean.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 14, 2020, 3:37pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/13 "2020-04-14T15:37:00Z")

</div>

You gonna love this

> [@Discourse as a simple personal blog engine](https://meta.discourse.org/t/discourse-as-a-simple-personal-blog-engine/138244/4):
>
> There is a hidden site setting for this grinning rails c SiteSetting.always\_include\_topic\_excerpts = true I believe it just add the data to the JS model, so you still need a client change to actually show it.

---

<div class="post-metadata">

### Author: ![zcuric](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zcuric/32/292837_2.png) [@zcuric](https://meta.discourse.org/u/zcuric)
#### Post date: [April 14, 2020, 3:38pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/14 "2020-04-14T15:38:07Z")

</div>

OMG! Why is that hidden?! :smiley:

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [April 14, 2020, 4:26pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/15 "2020-04-14T16:26:43Z")

</div>

Because there is a lot of support topics from admins who go and click on all the settings without reading. That means lots of instances would have a heavier payload without ever using the extra data coming from the API.

Soon, [themes will be able to declaratively enable those serializer changes](https://meta.discourse.org/t/theme-modifiers-a-brief-introduction/150605).

---

<div class="post-metadata">

### Author: ![JammyDodger](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jammydodger/32/254611_2.png) [@JammyDodger](https://meta.discourse.org/u/JammyDodger)
#### Post date: [June 8, 2024, 12:36pm UTC](https://meta.discourse.org/t/get-excerpt-for-regular-topics/33482/16 "2024-06-08T12:36:39Z")

</div>

This topic was automatically closed after 3184 days. New replies are no longer allowed.
