Rendering Component in decorativeWidget API

AI-generated summary

Rendering Component in decorativeWidget API

Clement_Decou is trying to render a component ({{numeramaAdsBlock "side_ad"}}) inside the sticky sidebar of a topic using the decorateWidget API. However, they are unsure how to render the component with parameters.

vinothkannans suggests that rendering a component within a widget might not be possible, citing a previous topic. Clement_Decou is looking for a solution that doesn’t involve copying code or rendering incompatible with future updates.

vinothkannans recommends changing the component to a widget, but acknowledges that they don’t have a solution right now.

merefield points out that the situation has changed and suggests investigating a solution using Select Kit components within plugin code, sharing a relevant topic on Meta Discourse: https://meta.discourse.org/t/render-a-component-within-a-widget-using-select-kit-components-within-plugin-code/84462/5?u=merefield

Hello,

I have a component to render ads in my discourse {{numeramaAdsBlock "side_ad"}} and i want to render this component inside the sticky sidebar in a topic. So i use decorateWidget to add my component inside the widget “topic-timeline-container”

export default {
    name: 'sidebar-topic',
    initialize(container) {

        withPluginApi('0.2', api => {
            api.decorateWidget('topic-timeline-container:before', dec => {
                // rendering my component with params
            });
        });
    },
}; 

How can i render my component with the params ? Thanks.

Edit : Up ?

As per above quote looks like component in a widget is not possible. So rendering a component in decorativeWidget API is also not possible I guess.

Humm thanks for the reply
I see this topics.. but how can i “override” this “sidebar” without copiying code or rendering incompatible with a new update ? (Without widget)

There is no solution ?

Thanks

May be you should change your component as widget.

I don’t have any solution right now.

이후 상황이 바뀌었으므로 조사할 가치가 있습니다: