Add Banner/HTML (Widget) before reply button

AI-generated summary

The discussion revolves around adding a banner/link before the reply button in a Discourse forum. OrkoGrayskull initially shares a working widget code that displays a banner after the first post of a thread, but wants to move it before the reply button.

Moin points out that the desired position is actually after all posts, not just the first post. piffy then provides the solution, suggesting the use of the topic-above-footer-buttons plugin outlet. OrkoGrayskull successfully implements the code and shares the updated example.

However, OrkoGrayskull encounters another issue, where the banner is only displayed for logged-in users. The problem persists despite using the topic-footer-main-buttons-before-create theme position, and a solution is still being sought.

I currently use the following widget to display a banner/link after the first post of a thread. This works fine so far:

<script type="text/discourse-plugin" version="0.8">
    const { iconNode } = require("discourse-common/lib/icon-library");
    api.decorateWidget("post:after", helper => {
        const firstPost = helper.attrs.firstPost;
        const h = helper.h;
        if (firstPost) {
            return h("div#support", [
                h(
                    'a.icon', {
                        href:'link',
                        title: 'Support-Icon'
                    }, iconNode('heart')),
                h(
                    'a.link', { 
                        href: "link",
                        title: 'Support-Link'
                    }, 'some text',
                ),
            ]);
        }
    });
</script>

However, I would like to integrate the banner/link in a different place - namely before the reply button. I have marked the position in red below:

Can anyone give me a tip on how to realise this?

I know that the position/job is defined by this. The question is how I find this NAME:LOCATION:

api.decorateWidget("NAME:LOCATION", helper => {

The position you marked in the picture is after all posts of the topic. So when there are replies your banner would be below these and not directly below the first post.

There is a plugin outlet there called topic-above-footer-buttons


This helps you see them: (deprecated) Plugin outlet locations theme component

Then follow this guide:

Thank you. It worked.

Code example for Head:

<script type='text/x-handlebars' data-template-name='/connectors/topic-footer-main-buttons-before-create/team-support'>
	<div id="support">
		<a href="link" title="Support-Icon" class="icon">
			<svg class="fa d-icon d-icon-heart svg-icon svg-node" aria-hidden="true"><use xlink:href="#heart"></use></svg>
		</a>		
		<a href="link" title="Support-Link" class="link">text</a>
    </div>
</script>

Unfortunately, the button/banner is only displayed when the user is logged in. How can I ensure that the button/banner is also displayed for non-registered users?

I’m using this theme position: topic-footer-main-buttons-before-create