I am trying to make colne of this plugin: Custom Topic Button (group)
I am trying to add button at every single post , not topics.
But I do not know how to set my class connectors for injecting buttons or icons into post.
If I understand well plugin I noticed using this connector over this
assets/javascripts/discourse/templates/connectors/after-topic-footer-main-buttons/custom-public-button.hbs
If I want to add button in post menu how my connector should looks like?
AI-generated summary
The discussion revolves around adding a button to the post menu in Discourse using a plugin. adopilot seeks guidance on creating a class connector to inject buttons into individual posts, referencing a plugin that adds buttons to topics. Johani explains that posts use widgets and provides a code snippet using the plugin API to add a button to the post menu. They reference the addPostMenuButton method and point to the raw-post-button plugin as an example of implementation.
If you want to add a button to the post menu then you’ll need something a little bit different since posts are widgets.
You would need to add something like this to your theme / plugin.
api.addPostMenuButton("my-button", () => {
return {
action: "someAction",
icon: "someIcon",
className: "someClass",
title: "some title",
};
});
The plugin API has a method for adding new buttons that makes this relatively easy.
This theme component uses that method to add a new button to that menu based on some conditions and defines a new action, so have a look here