Topic List Previews (legacy)

This is now a Theme Component, the plugin is deprecated

The new Topic is Topic List Previews Theme Component - theme - Discourse Meta

GitHub-Mark-32px Repository: get the code here

See further here: Pavilion

sandbox Examples: check out the list further down.

:raising_hand_woman: Request a feature

:bug: Report a bug

:heart: Donate: we are reviewing our donations system. Please check back later :).

:man_technologist: Maintainers: @merefield

Overview

Topic List Previews allows you to:

  • Add images, excerpts, buttons and topic stats to topic list items; and

  • Change the layout and style of topic list items

  • Add ā€˜Featuredā€™ topics above topic lists and topics.

  • Add User Wall to Userā€™s activity page (aka ā€˜Portfolioā€™ Feature).

These settings can be applied to all or selected topic lists on a site-wide or category-specific basis.

This flexible feature-set allows you create a variety of different topic list styles, including

Basic Style

Relevant settings
  • topic list thumbnail
  • topic list excerpt
  • topic list action

Pinterest (Masonry) Style aka ā€˜tilesā€™

Relevant settings
  • topic list tiles
  • topic list thumbnail
  • topic list excerpt
  • topic list action
  • topic list thumbnail width
  • topic list thumbnail height

Featured Images

Relevant settings
  • topic list featured images tag
  • topic list featured images count
  • topic list featured width
  • topic list featured height
  • topic list featured title
  • topic list featured excerpt
  • topic list featured order

The main and Discovery settings are in Settings ā†’ Plugins. The Category equivalent are in each Categoryā€™s Settings.

Examples in the Wild :seedling:

More info:

Much more info available at: Pavilion

Contributors :raised_hands:

Many folks have contributed to the development of this plugin through both feedback and direct development work. In particular:

107 Likes

OK, all users of Topic List Previews, please take note below.

How to safely update when using our plugins:

Pavilionā€™s update schedule

Topic List Previews is one of the Pavilion family of open source plugins.

Going forward, Pavilion will focus on ensuring compatibility of a core set of its plugins with Discourse Core tests-passed branch during the first 5 days of every month only.

Any bugs which arise because of an incompatibility will be addressed asap during this ā€˜supported periodā€™, preferably by the 7th day. Low severity or Beta feature bugs may not be addressed by this date, but obvious things which are ā€˜breakingā€™ a forum should be resolved.

This new policy will come into effect 1st May 2020

Why we are introducing this policy

We have no control over changes in Discourse core. That is how it should be. However, as our plugins have grown and become more sophisticated, it is getting more and more burdensome to guarantee they are working with every update of Discourse. Itā€™s becoming untenable to ensure immediate compatibility is maintained.

To give our developers breathing room so they can attend to other priorities in addition to plugin support we will no longer be guaranteeing compatibility with Discourse every day of the month.

This policy should also help you achieve more stability and give you more certainty over when you can more safely update.

How to perform your update

Aim to update your Production Discourse instance (both Discourse core and our plugins) in the first 5 days of every month. Notify us on the relevant Plugin Topic on Meta of any issues you encounter. You will get more focussed support from the Pavilion team on any issues with their plugins during this period.

You update your Production server outside of the first 5 days of the month at your own risk. If you do so and something breaks related to one of our plugins, we urge you to report it and in addition, and if appropriate, uninstall our plugin until it is resolved. Unfortunately we may not get around to fixing it until the next supported period at the beginning of the following month.

For even greater safety

Consider testing your update on your own staging server built from a back-up of your production site. This is especially important if your site is large, popular and/or part of a business.

You can switch this server off for the rest of the month so you donā€™t get charged for up-time. Use this opportunity to test out all basic functionality to identify any issues with plugins. Report all critical and high issues asap on the relevant plugin topic.

Using a staging site may allow you to have more discretion over when you update, but be aware of the relative lack of support in the latter part of the month.

Thanks for your understanding!

(we will be shortly adding this policy note to all our core plugins and Iā€™ve added it to the OP of this Topic).

8 Likes

Is it possible to get the topic list preview thumbnails on ā€˜latestā€™ topics in the hybrid view?

1 Like

Yes it might be possible by amending this template and adding relevant settings and route support: https://github.com/discourse/discourse/blob/master/app/assets/javascripts/discourse/app/templates/components/latest-topic-list-item.hbs

Because of the lack of space itā€™s not been prioritised. Recent priority has been to get the known bugs resolved.

That and the fact that I also need to earn a living :wink: Itā€™s not an insignificant amount of work just to keep this plugin operational after breaking changes in core. And the more features you add ā€¦

2 Likes

OK community, following on from @ozknā€™s post would people prefer icons or words for Tiles meta?

ie this as currently:

or update to something more along the lines of this?:

  • Stick with lettering
  • Use icons

0 voters

2 Likes

That seems like an obvious trend so ā€¦

Canā€™t promise such a fast turnaround on every new request, but that is done:

image

Enjoy :tada:

https://github.com/paviliondev/discourse-topic-previews/commit/c34db7f9d45d48d530442c0b58f118f0f8f7f241

Iā€™ve also done some other minor fixes to mobile formatting.

5 Likes

thanks for the quick return @merefield

2 Likes

FYI everyone. Assuming there are no bugs discovered that are critical or high in severity this is the last day of the month for supported upgrades.

After today, if you intend to upgrade please check compatibility of this plugin in a staging environment.

Weā€™ll repeat the ā€œsupported upgradeā€ period next month in the same 5 day schedule.

Thanks for your understanding.

4 Likes

Discourse has released some significant changes to bring native support for thumbnails. This has broken some existing dependencies.

However, this is a good opportunity to simplify the plugin.

Iā€™ll be working to remediate where possible and integrate the new Discourse platform features.

In the meantime TLP is no longer fully compatible with the very latest tests-passed Discourse.

Please do not update your site until further notice unless you are happy to suffer some minor incompatibilities.

The biggest ones Iā€™ve identified so far are:

  • that the hotlink setting will no longer work so make sure itā€™s disabled. Iā€™ll be removing this feature as thumbnailing has become native.
  • thumbnail picker can show the wrong preview but seems to ultimately still function.

It may take me a while ā€¦ Iā€™m hoping to have something to show before beginning of next month, hopefully sooner.

9 Likes

Is that why after updating the fields like image_url cannot be found in https://meta.discourse.org/latest.json

image

But when using Data Explorer I found it. So why not stay!

Is there a way to handle it manually while waiting for an update?

1 Like

Does switching off Hot-linking help?

Updates may take some time. It is now Pavilion policy we do not support Production outside days 1-5 of the month.

3 Likes

FYI guys, Iā€™m working on an experimental Theme Component version of the plugin.

Itā€™s missing some features and there are still various issues. Use it for fun, but itā€™s not supported (yet!)

https://github.com/merefield/discourse-topic-list-previews-theme

7 Likes

Yesterday I had to rebuild Discourse for other reasons and an upgrade came with it. Seems to be working so far (we are not using hotlinking).

I like the UI improvements showing views and replies in the tiles, thank you very much. I also like the fact that ā€œheartsā€ appear in the right places and in the right way. I donā€™t know exactly what has changed, but before they felt too prominent and visible everywhere.

A suggestion: currently the count of hearts relates to the first post only. Would it be possible to show the total number of hearts in the entire topic? It brings the numbers up, also making more justice to the topic (sometimes the first post might have just 1-2 likes but the discussion is very ā€œlikedā€). It would be consistent with the data on views and replies, which refer to the entire topic.

Oh, and what about not stretching images beyond their size? Currently big images will be reduced to the max width setting (good), but smaller images are forced to have that max width too, which is probably not desired because pixelation. Having the image centered with its own max size would be better imho.

3 Likes

This is great! Does this mean that thumbnails will now be served from S3 CDN urls instead of directly from S3?

Thank you so much for all your work on Topic List Previews!

2 Likes

Thank you!

Thatā€™s something we need to clarify with the Discourse team.

The Theme Component version is being developed to explore the potential to support the emerging extensions to the core API that David has been discussing here.

It is up to Discourse where these come from and how they are handled, as a Theme Component contains no API.

This new extension to the API exposes thumbnails. Historically these were generated by this Plugin. I will be very happy to retire that logic if at all possible, though there may still be work Discourse will need to do to reach the full level of functionality Iā€™d need it to have to do that.

1 Like

Thanks for your nice feedback!

I canā€™t promise that will be easy or performant, but a nice idea!

For Tiles that wonā€™t work because it would look very strange not to have an image taking up most of the tile width. It would look less blurry, perhaps, but would also look a bit messy as youā€™d introduce arbitrary new vertical edges on the page.

Another solution, if you have a lot of smaller images, might be to increase the number of columns. You can do that with just CSS.

Alternatively, if you are not referring to tiles view, you could easily use CSS to make the non-tiles view thumbnails appear smaller.

1 Like

I donā€™t know if youā€™re looking for feedback yet, but this is what it looks like on my staging site :crazy_face: I have TLP and Topic Thumbnails disabled.

3 Likes

What if smaller images were centered vertically and horizontally within a box to match the size of other posts?

2 Likes

Feel free to experiment with your CSS. If you are using the plugin version you should also be able override the topic list item template too in a theme component.

If you get something looking good please share.

1 Like

Featured Images Is it image_url or thumbnails?
So does Theme Component version of the plugin solve the current problem?

1 Like