Adding a header link for Guests Only

Hi,

After one too many spam attacks, I have set my forum to invite-only, and set up a custom, rate-limited, way of handing out invites on my other web site.

I’ve added links to the invite system to the FAQ and such, but I’d like to add a custom “Create Account” link next to the Log In link that is similarly only visible when the user is not logged in.

The official Custom Header Links did not seem to have this feature (unless I missed something).

I tried adding a link using api.decorateWidget but that generated a depreciation warning, so clearly that was not the right way.

That suggested I need to use api.headerIcons.add(“foo”, FooIcon, { before: “search” }), but if I understand that, FooIcon is some sort of Component, and I don’t know what that is or how it would be created.

So basically: I want to add a “Create Account” linked to a specific URL, next to the Log In button, when the user is not logged in. And I don’t know much at all about Themes or how to edit them.

Thanks for any assistance.

1 Like

I’m not sure I understand what’s not working: if you just need to add a link, then what’s missing here?

Edit: As usual, Moin reads better than me :eyes:

You can hide links added with that component for logged-in users with custom CSS.

1 Like

I also remembered DiscourseConnect Signup Button. But I think that only works if you are using DiscourseConnect.