dsims
(Daniel)
13 فبراير 2025، 7:12م
1
I want to add the topic-creator avatar to topic-list excerpts, but there doesn’t seem to be anyway to modify the Topic Excerpt.
TopicExcerpt:
I think the only option is to hide .topic-excerpt
with CSS and use my own component via the topic-list-main-link-bottom
Plugin Outlet which is right under the TopicExcerpt area. The problem with that is the plugin outlet only gets the topic as an arg, so I have to duplicate all the logic in expandPinned
to know if I should be showing it or not.
tl;dr; Could we get a PluginOutlet inside the TopicExcerpt and/or pass @expandPinned
to the topic-list-main-link-bottom
outlets?
إعجاب واحد (1)
You have more options now, see:
The topic-list is one of the most-used and most-customized user-interfaces in Discourse. There are many different tools available to theme and plugin developers to achieve this customization, each with their own advantages, disadvantages and maintenance considerations.
CSS-based Customization
The safest and most common customization method is CSS. As with any other Discourse customization: the more complex your changes, the more maintenance is likely to be required in your theme or plugin.
Gen…
إعجاب واحد (1)
dsims
(Daniel)
13 فبراير 2025، 7:31م
3
I’ve looked into all the options AFAIK. There is no surgical way to modify the just the excerpt that I can see.
yes there is, delete it and add your own
dsims
(Daniel)
13 فبراير 2025، 7:40م
5
You mean replace the whole topic-list-item with my own? I’d like to avoid having to maintain all that when I only want to modify a small piece.
no, replace the excerpts cell, or add another one next to it and hide it.
dsims
(Daniel)
13 فبراير 2025، 7:46م
7
The excerpt is not a cell. It’s used inside the topic-cell and in the mobile item
You can also see there that the nearby topic-list-main-link-bottom
plugin-outlet only passes the @topic , but not @expandPinned .
إعجاب واحد (1)
Ah yes you are right, apologies.
I saw the file in the topic-list components and made an assumption.
But in any case, there’s loads of tools to achieve what you want here, no?
Plugin outlet looks like a good option and then manipulate the layout with CSS?
As for the expandPinned, maybe replicate the logic in your new Component as much as you need to?
dsims
(Daniel)
13 فبراير 2025، 8:35م
10
Yeah that’s the path i was going down. Which also means replicating
get useMobileLayout() {
return applyValueTransformer(
"topic-list-item-mobile-layout",
this.site.mobileView,
{ topic: this.args.outletArgs.topic }
);
}
//and from discovery/topics.js
get expandGloballyPinned() {
!this.expandAllPinned();
}
get expandAllPinned() {
const category = this.discovery.category?.id
const tag = this.discovery.tag?.id
return category || tag;
}
I was hoping pleading to the gods might produce a cleaner option
إعجاب واحد (1)
That’s what I’m usually doing on a Monday morning.
إعجابَين (2)
this seems reasonable, so I’ve done this here:
main
← dev-expandpinned-outlet
opened 08:33PM - 13 Feb 25 UTC
Requested on Meta, seems reasonable: https://meta.discourse.org/t/modify-topicex… cerpt-template/352136
5 إعجابات
system
(system)
تم إغلاقه في
16 مارس 2025، 2:40م
13
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.