New th in topic table

AI-generated summary

The discussion revolves around adding a new <th> element to the topic table in Discourse. Shatabdi_Dash seeks help to create a new header column in the topic list, aiming to display data from the post_replies table and enable a button to insert the last reply into a container. Lhc_fl suggests using Handlebars templates and overriding them via a theme component, referencing the Discourse source code and plugin outlets. Jagster and Lilly support this approach, emphasizing its validity. Hawm provides additional links on using raw plugin outlets. Canapin interprets the lack of clarity as a need for guidance on template overrides, recommending the official theme development guide. Shatabdi_Dash clarifies the goal, while pfaffman asks for a clearer explanation of the desired functionality.

I want to create a new th in the topic table <topic-list.ember-view> in the thead class . Can anyone tell me how can I do this.

You need to have some prior knowledge of handlebars. Then, go through the source code of discourse and find the corresponding path.

https://github.com/discourse/discourse/blob/main/app/assets/javascripts/discourse/app/raw-templates/topic-list-header.hbr

Then create a new file with the same name in your theme component according to the path to overwrite it, just like the example below

https://github.com/discourse/discourse-mobile-op-avatar-component/blob/main/javascripts/discourse/templates/mobile/list/topic-list-item.hbr

This is not helpful.

Why not :flushed_face: It is a valid answer AFAIK.

That is unfortunate because it is the correct answer and @Lhc_fl is very helpful.

What part don’t you understand? What you are a asking is not necessarily an easy change to make for someone who is not familiar with Discourse development using handlebars templates.

Or using the raw plugin outlet?

It feels to me that “this is not helpful” means here “I don’t know how to do that”.

Please read our official guide: Developing Discourse Themes & Theme Components.

There are several ways to overrides templates (which is a solution for which you are trying to achieve). One is described in this section: https://meta.discourse.org/t/beginners-guide-to-developing-discourse-themes/93648#overriding-discourse-templates-23

I want to get the data from the <post_replies> table. and use it in the button which is present in the < topic-list-table> for every row it will different posts so according to the post id it will retrive the last reply and when click on the button present in the table it will paste the last reply in the container.

I still don’t know what you want to happen. Maybe say what you want to happen without describing anything about how to do it.