Topic List Previews

Is it possible to only enable this plugin for Theme A while disregarding it on Theme B?

2 Likes

Yes if you use the TC

2 Likes

Thanks. Pardon my ignorance, but what is TC? Theme component…?

2 Likes

Yes. If you use the below theme component and not the plugin.

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

3 Likes

Thanks for the response! So far I haven’t experimented yet because I barely have a basic understanding of CSS. Would you mind pointing out a general direction so I could try experimenting? I am not sure which section of the code is responsibel for tag behavior.

20 tags is indeed a lot. It happens because we use the forum to share writing, and users absolutely go crazy when they tag their own creations. :wink: Its quite nice though because it makes locating content according to different characters, settings and relationships super easy.

1 Like

The quickest way to expedite this is to share your site. You can PM me if you prefer.

You need to get used to using the Browser Inspector and modifying Themes, even at a basic level. Beginner's guide to using Discourse Themes Then Developer’s guide to Discourse Themes

Use the Browser Inspector to find the right bits. Experiment. Here’s the guide for Firefox: Page Inspector - Firefox Developer Tools | MDN

It might seem a lot to learn, but it’s worth it, quite rewarding and help you administer your site more effectively in the future.

2 Likes

@merefield It’s update time! :tada: Are there any known issues?

3 Likes

Not that I’m aware of. I’ve rebuilt two sites this morning and both the TC and the plugin seem to be working fine.

3 Likes

Dear @merefield I am so grateful for your plugin and I would like to contribute the solution for this problem. I don’t have the dev environment set up to do a pull request but this seems to fix the problem.

You can try this solution:

In this file: https://github.com/merefield/discourse-topic-list-previews-theme/blob/master/javascripts/discourse/templates/list/topic-meta.hbr

Replace:

  <div class='topic-replies posts-map {{likesHeat}} inline sub' title='{{title}}'>
    <a href class='posts-map badge-posts {{likesHeat}}'>{{d-icon "far-comment"}}{{number topic.replyCount}}</a>
  </div>

With:

	  <div class='topic-replies posts-map {{likesHeat}} inline sub' title='{{title}}'>
        {{d-icon "far-comment"}}{{number topic.replyCount}}
      </div>

Basically, getting rid of href tag around the comments. I don’t know the significance of it but removing it will allow you to select the different comments and navigate to them inside the topic.

Thank you for your support.


Here is the original issue:

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

I believe, I found a bug in the Topic List Preview List when someone clicks the “Replies”.

Ideal situation:

Click the replies for the topic in the topic preview list, you get to select the Dates and you choose one and it takes you to the topic details.

My problem:

Click the replies for the topic in the topic preview list, I see the Dates selection, but before I chose one, Topic List Preview page refreshes and it doesn’t take you to the Topic details.

5 Likes

Absolutely delighted if you would submit a PR to fix this.

So, consider properly setting up a dev environment to allow you to test this and submit accordingly.

However, this is not the issue I don’t believe.

In the non-tiles view you screenshot, it’s actually using the the core template.:

(for plugin dev, our mantra is never diverge from core code unless you really have to, especially when it comes to templates!)

{{#if notTilesStyle}}

SNIP

  {{raw "list/posts-count-column" topic=topic}}

(see https://github.com/merefield/discourse-topic-list-previews-theme/blob/master/javascripts/discourse/templates/list/topic-list-item.hbr)

I don’t believe for non-Tiles view it ever visits the file you reference: https://github.com/merefield/discourse-topic-list-previews-theme/blob/master/javascripts/discourse/templates/list/topic-meta.hbr

This is only used for Tiles view. The icons in the template are the give-away.

But don’t let me dent your enthusiasm, please get set up and go for it and I will review any PR you submit.

If you could go further and fix this for Tiles view too that would be even better!

3 Likes

Thanks @merefield for the feedback. I reviewed the code again. You are right, for non-tile style, the core template is used. For tile style, my proposed solution could fix the issue.

I will take time for the PR though and when it is ready, you will receive one.

Thanks again for your support!

3 Likes

The update went without a problem :pray:

4 Likes

Yup, I released a mid-month fix for a break and we’ve been lucky the rest of it :slight_smile:

7 Likes

Thanks for this awesome work! is it possible to apply preview to only one specific tag? i.e filter by other tags will show them with default view.

1 Like

The same requirement for me, too:

1 Like

We already support discretion over the tags discovery route. No plans to increase complexity by targeting specific tags at present, settings is already a rats’ nest?

Perhaps if this was a funded piece of work … Feature Request

3 Likes

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

I installed this plugin on new discourse instance and version of this instance is 2.6.0.beta2 . Earlier it was working fine.but now It is working. but all posts are not visible after i open any topics. Can you help me out ?

I attached some images here.

2 Likes

Are you on latest discourse?

yes.

1 Like

Please note we are outside the support window (see the OP).

However, cannot reproduce. That doesn’t look like recent TLP code? (be my guest, search for .router on GitHub). Perhaps you’ve got another plugin or theme component installed that is causing that error? Breaking javascript will stop TLP (and other things) in its tracks. I suggest you remove all plugins and TCs except TLP and try again, then add them back in one by one to find the culprit.

1 Like