Topic List Previews


#64

Yes, it’s part of the topic list action setting:


#65

Thanks for your answer. It works!
Another question, can I use it on my different categories? For example, I create a new category named ‘ABC’. Can I use this topic-list-preview for my new category?

Just like the screenshot below, can I use it here?


#66

Yes you can … there are settings for each Category via the Edit wrench:

image


#67

My teammates always say I’m an idiot…
Just select ‘Latest’ here? If I have a topic, which belongs to this category, but does not belong to ‘Latest’, will it be shown as expected?


#68

I think you need to have a play! :wink:


(jjaarrvviiss) #69

We are using Tiles View on our site and want to highlight specific topic tiles based on the group the poster is a member of. We have a user group that is a higher Patreon level… and want to add a specific CSS class to topics posted by member of this group. I dug into the plugin code, but can’t quite find out how to accomplish this. I’m guessing it needs to happen in preview-edits.js.es6?


#70

That’s correct. You might consider toggling a class based on group membership in component:topic-list-item and format your highlighting in CSS

However, I would urge you to consider this functionally first - whats the full criteria for highlighting a topic? Are you in essence wishing to highlight watched items based on membership of a group and some additional criteria?


#71

I tried the “social” theme, but it looks a little strange.

My setting is as follows:

I need your help! Merefield


#72

For a start don’t have Tiles and Social on same route. Tiles is very close to being a tiled view of Social. Turn one of them off! Unfortunately the functionality to force mutual exclusion does not exist, apologies, but workaround is simple :slight_smile: I’ll add as issue on repo.


#73

Thanks a lot! You are my hero.
I just tried this: Is this correct?

I just “Turn one of them off”…


#74

Yes that’s correct. Haha, no problem


#75

I did it… but it looks still strange… Any idea?


#76

Yes, sorry, you should also be aware this format is intended for narrow views, e.g. phones or 16:9 tablets in portrait.

It does look awkward on wider browsers.

If you have a view with more width use Tiles or switch both Tiles and Social off.


#77

Understand! Thanks!
Can I add a width here? through ‘Theme Component’


#78

You can definitely play around with the CSS all you like using your own Theme Component, but I don’t recommend using Social for normal desktop browser views (better for -mobile) … you will lose a lot of real-estate.


(jjaarrvviiss) #79

Ok that makes sense. I’m just not sure how to get the group membership, I assumed I need to pull it from topic.creator.group_primary_name but that didn’t seem to work. I’m guessing I may need to get the Original Poster user id and then query user.json

We want to highlight or somehow visually signify the topics posted by members of this speicific Patreon group level. If original poster is member of group, then toggle on CSS, if not then leave as usual. We just want the posts by members of this group to be visually distinguishable from all the other posts in the tiles view stream.

Thanks for your help and thoughts on this! I appreciate it.


#80

One caveat … i’m not sure you can check private group membership yet from client …but that’s coming …

So if your group is private (you don’t let everyone know who your patreons are) you may need to hold off…

And if you want to know if a post is from another patreon member you may need to determine that by modifying the stream from the backend … this is going to impact more than the client javascript I expect …

Possibly need to add to topic_list_item_serializer.rb

You might find this example helpful


(jjaarrvviiss) #81

So these are closed groups but they are not private… they are publicly visible. If I look at latest.json I can see the primary groups are posted for users so I think I can access them from within the plugin.

I can see that having all the groups serialized would be useful, I can just check against that list. But I can also just use the primary group, since that works for our site too.

I’m just having trouble grokking the API, is there any API docs for discourse? I’ve looked but can’t seem to locate them.


#82

imho you just need to add an additional attribute “patreon_member_topic” (true or false) or something … then toggle a class on or off based on that in the javascript.


(jjaarrvviiss) #83

oh ok, I’ll see if I can try that route. thanks!