I feel silly even asking this, but I’ve tried every variation I know of and my javascript is not strong… Anyhow, I’m trying to add multiple menu items to the hamburger menu via the api.decorateWidget function.
I’ve tried this:
<script type="text/discourse-plugin" version="0.4">
api.decorateWidget('hamburger-menu:generalLinks', () => {
return [{ href: 'https://yinyanghouse.com/', rawLabel: 'Our Blog' }, { href: 'https://store.yinyanghouse.com', rawLabel: 'Our Store'}];
});
</script>
But that doesn’t show up – doing it like this does work:
<script type="text/discourse-plugin" version="0.4">
api.decorateWidget('hamburger-menu:generalLinks', () => {
return { href: 'https://yinyanghouse.com/', rawLabel: 'Our Blog' };
});
api.decorateWidget('hamburger-menu:generalLinks', () => {
return { href: 'https://store.yinyanghouse.com/', rawLabel: 'Our Store' };
});
</script>
But it seems like there should be a way to put those into an array and return that?