How to move the topic-map widget so it appears above the post's content

AI-generated summary

stevenpslade sought to move the topic-map widget above a post’s content. Initially, they were unable to find it in the post.hbs or topic.hbs templates. stevenpslade later discovered that the topic-map is called as a widget in the post widget. To reposition it, they created a post.js.es6 file in their plugin, copied the contents from the Discourse repo, and modified the code to use unshift or splice instead of push. This allowed them to move the topic-map above the post content, with splice providing a more desirable positioning.

Looking to alter topic-map but cannot find it in either the post.hbs or topic.hbs. I have tried altering the component template via discourse/templates/components/topic-map.hbs but it does nothing. Perhaps it is because topic-map is a widget now? In which case, where is the widget called?

Ultimately I will be planning on repositioning topic-map to be on top of the post rather than underneath it.

I have more or less figured out what I needed to know. Here is what I’ve found for anyone else interested.

Although in the Discourse repo there is still a topic-map component, it doesn’t seem to be called. However, the topic-map widget is very much present is called in the post widget.

In my plugin, I have created the path discourse/widgets/post.js.es6 and copied the contents of the file matching this path from the Discourse repo. Then look for this line hereL result.push(this.attach('topic-map', attrs)); and change push to unshift. This will bring the topic-map to above the post content.

However, unshift brings it to the front of the array, even above details like date posted and the poster’s username. So if you use: result.splice(1, 0, (this.attach('topic-map', attrs))); then it will place the topic-map in a desirable position.