Adding header links post vdom upgrade

Ah, well this worked:

<script type="text/discourse-plugin" version="0.2">
api.decorateWidget('header:after', helper => {
    const showExtraInfo = helper.attrs.topic;
        if(!showExtraInfo) {
            return helper.h('div#header-links', [
                helper.h('a#recruiter', {
                    href:'https://sih.onemadogre.com/t/joining-sih/494', 
                    text:'Join Us!'
                }),
                helper.h('a#about', {
                    href:'https://sih.onemadogre.com/c/guild-news-announcements/about-the-guild', 
                    text:'About SiH'
                })
            ]);
        }
});
</script>

After noticing the links were working, just being overridden by the home page link, I switched to using the header widget instead of home-logo. I didn’t use header at first due to missing the bit that detected whether or not topic info was loaded, but found it on a second pass. :slight_smile:

I would still appreciate any advice on whether or not this is the best approach - this seemed like the most straightforward way to me, but yeah.

Oh, blurgh. Except positioning the links isn’t quite working now, having it right after the home logo was quite convenient. >.>

3 Likes