Topic List Excerpts

AI-generated summary

The Topic List Excerpts theme component allows users to enable excerpts for unpinned topics on Discourse. Discourse provides a summary of the component, including a preview and repository link.

The component has settings to control its behavior, including show excerpts mobile, show excerpts desktop, enabled categories, and enabled tags. Paracelsus and david discuss restricting the component by category, and david fixes an incompatibility issue with the Topic Thumbnails component.

Users, including downey, th21, and David_Ghost, report issues and request features, such as adjusting the word length of excerpts and showing the latest post instead of the first post. dsims suggests a plugin for showing the latest post excerpt. David_Ghost and eisammy report a problem with avatars on desktop, and Jagster notes that the excerpt toggle button is not visible on mobile.

WorldIsMine asks about blocking excerpts from showing on private messages, and Canapin responds that the component does not show excerpts on personal messages by default. Users can customize the component using CSS, as demonstrated by Arkshine.

:discourse2: Summary Topic List Excerpts allows you to enable excerpts for unpinned topics (by default, Discourse only displays topic excerpts for pinned topics).
:eyeglasses: Preview Preview on Discourse Theme Creator
:hammer_and_wrench: Repository Link https://github.com/discourse/discourse-topic-excerpts
:open_book: New to Discourse Themes? Beginner’s guide to using Discourse Themes

Install this theme component

Features

Works great alongside Topic List Thumbnails in “list” mode!

:information_source: The excerpts themselves are generated by Discourse Core, using the same logic as the excerpts of ‘pinned’ topics. If you have a query / suggestion about how the excerpts are built, please make a new Support topic.


:bulb: Tip: you can keep line breaks in excerpts by adding this CSS to your theme:

.topic-list .topic-excerpt {
    white-space: pre-line;
}

Be aware that results may look off depending on the posts’ contents.

Settings

Name Description
show excerpts mobile
show excerpts desktop
enabled categories Enable excerpts in specific categories. Leave both categories and tags blank to show excerpts on all routes
enabled tags Enable excerpts in specific tags. Leave both categories and tags blank to show excerpts on all routes.

:discourse2: Hosted by us? Theme components are available to use on our Standard, Business, and Enterprise plans.

Last edited by @JammyDodger 2024-06-15T19:28:50Z

Check documentPerform check on document:
47 Likes
MD Topic List component
Best way to implement Excerpts in topic list?
Topic preview text
Topic List Previews (legacy)
MD Topic List Mobile component
Static content on Category main page
How to keep line breaks on excerpts?
Customizing your site with existing theme components
Expand new posts in topics in "Unread" and "New" to full summary
Topic Author
All links to categories broken?
Discrepancy in display of user activity (all / replies vs topic)
Topic List Latest-Post Excerpt
Compact and AI Expanded
Displaying Views in Topic view (with no replies)
How to show part of the text under the topic head?
Topic List Latest-Post Excerpt
Google complaining about slow Interaction to Next Paint (INP) on Discourse sites
Discourse AI Topic Summary :robot:
Formatting breaks when Topic (List) Excerpts theme component used with RSS Polling plugin
Display first 5 lines of every post
Discourse AI Topic Summary :robot:
How to disable topic excerpts in category page
Topic List Thumbnails
How to add topic excerpt to all my topics
Display post content in homepage
Display post content in homepage
New users can't sign up, 404 errors in console
Is there a way to display topic contents in category view?
Topic List Thumbnails
Discourse Docs
Information about topic is not updated when using new & unread topics banner
Discourse Category Lockdown
Topic List Previews (TLP)
How to change the topic excerpt from the first post to the last post?
Topic Excerpts & AI Gists Button
Topic List Author & Posters
Latest activity list as for replies
Why do excerpts include some HTML tags, but not others?
Is there a plugin to make my forum a shop?
Display replies and likes count in mobile view
Display in the topics list in homepage also the body topic
Potential way to hide ignored users from topic list?
Using Discourse as a social media platform
How can I keep post views on lists
Show latest reply hint on Latest list mode

Great, a blog-like topic listing (together with Topic List Thumbnails Component)! :clap:

Can it be restricted by category like the other component?

7 Likes

Sure, I just added a category setting:

https://github.com/discourse/discourse-topic-excerpts/commit/aed85ba07007d38fe98de8889e3b155c69aeb812

14 Likes

Thanks, much appreciated.

I also take the chance to report that there is some kind of incompatibility with the Topic Thumbnails component, since the images appear twice for each topic in the topic list (topic list option on thumbnails component + topic excerpts component).

2 Likes

You’re right, sorry about that. Should be fixed now

https://github.com/discourse/discourse-topic-excerpts/commit/301f77e50c8ed231d7e4c8cb6ce69d35c7e06707

9 Likes

Love this component; thank you! Is there any way to adjust the word/character length of the excerpts displayed in topic lists? (Never mind, I found the topic excerpt maxlength site setting, adjusted it, and rebuilt HTML for the topic posts in question.)

4 Likes

The category setting works but the tag setting is not working on the latest discoures.

2 Likes

@th21 tag handling should now be fixed - sorry for the delay!

3 Likes

A post was split to a new topic: Being able to display excerpts for some categories only on /latest

A post was split to a new topic: Differentiate contents from the topic list rows using different colors

Hi,why the read more is grey in my site but in yours is blue, how can i chane the color?

1 Like

Hi, you can use CSS to customize.

For example, using the predefined color for links. Though, you can provide the color you want.

.topic-excerpt-more {
    color: var(--tertiary);
}
1 Like

Hi, this component gets rendered on the discourse docs plugin page and makes the excerpt clickable to the url of the discourse discussion not the doc url, is there anyway to avoid this from happening?

Hi, it’s possible to show the latest post instead of the first post?

2 Likes

I have a plugin + theme-component for this: Topic List Latest-Post Excerpt

2 Likes

There is a problem with the theme component in desktop?

when i have it enabled, thats shows avatars like that:

i have updated my discourse today

EDIT: IS there a way to limit the number of lines/characters for the excerpt?

2 Likes

Yeah same here

Lastest it’s okay when logouted but others routes when discourse-right-sidebar-blocks are enabled this happen

The excerpt toggle button isn’t visible on mobiles. By desing, an accident or am I asking too early?

I love this! Is there any way to block excerpts from showing on private messages?

I’ve tried this component, and it doesn’t show excerpts on personal messages. :thinking: