Cannot get the Custom Header Links to display?

AI-generated summary

In a support thread titled Cannot get the Custom Header Links to display?, user lejeczek reports that custom header links aren’t appearing for logged-out or logged-in users, despite enabling the Custom Header Links component and setting it to display on Default. Lilly advises checking if the Default theme is active and suggests using the preview button to verify settings. JammyDodger notes the links appear in the inspector but are greyed out. Lilly confirms it works on her setup. lejeczek confirms using version 3.0.6 and a vanilla setup. Lilly recommends upgrading to 3.10 or 3.2.0 beta1-dev due to core changes affecting components. JammyDodger discovers that removing locale tags (e.g., en) from example links resolves the issue, suspecting recent changes in how / or locale handling works. Lilly confirms locale settings are now part of the component’s field description. JammyDodger confirms locale removal fixes the display. Lilly advises lejeczek to remove locale settings entirely. lejeczek reports no change. JammyDodger suggests locale support may require a newer Discourse version. Lilly requests lejeczek share the settings editor content. lejeczek shares a screenshot showing no settings editor button — Lilly suspects this is due to the outdated version and shares her working settings, including example links like Meta and FAQ, and notes mobile view crowding. She reiterates upgrading Discourse is likely necessary.

Hi guys.
As a novice I must assume I’m missing something.
I in Customize → Themes add included components : custom header link
Then in Components → Custom Header Links I add Include component on … : Default

None of pre-set nor my own links appear in the header, when a user is not logged in header only has log in sign up & search icon, on the right.
What is it that I’m missing?

Make sure you are actually using the default theme as your theme.

You can also preview it or the component by using the preview button at bottom to check the settings. This makes it easier to set up components and themes before rolling them out to forum users.

Also double check to make sure you are setting up the header links properly in the component. Check the default ones to see how they are setup.

I’ve just given it a try out on my test site, and mine isn’t showing up either.

It’s in the inspector, but greyed out for some reason?

working on mine

I do have those, yes. Themes → Default → Theme is enabled by default
Setup is virtually plain-vanilla, it’s a test-lab.
It appears as if CHL had no effect on my setup, preview or non-logged user, no header at all.
non-logged-in user → sign up & login only,
logged-in user only only three icons: chat, search, user.
version is 3.0.6

You should upgrade to 3.10 or 3.2.0 beta1-dev

I strongly suggest you upgrade your Discourse because there have been significant changes in core since that version, some that affected theme components.

I too see it, get it that way.

After a bit of fiddling, I think it’s the example links which are out of date. I think there’s recently been a change to how a plain / is handled. which are causing an issue.

Getting rid of all the example ones and adding something like:

A link, a link, https://meta.discourse.org, vdm, blank

does work:

field description also shows a new Language locale setting (see my second screenshot above) :thinking:

FWIW I just downloaded and installed the component without changing anything, including default links, and it worked :woman_shrugging:t2:

I think you’ve found the winner. :trophy: :slight_smile:

When I remove the locale from the example ones they show up. :+1:

It must be because I’m not on en. That is a little confusing. :slight_smile:

yea I’m on en so that would make sense now.

@lejeczek if you remove the en|language setting at the end of the field strings, it should work.

Makes not difference to mine. When CHL got installed, pre-set links included, do explain what @Lilly snapped, locales, eg. of a pre-set link:

External link, this link will open in a new tab, https://meta.discourse.org, vdo, blank, remove, en

adding one similar to that also has no affect.

Can you try it without a locale at all? It may need a newer version of Discourse for that setting option to work.

@lejeczek can you please paste the content of your settings editor? (button at bottom right of component)

Whether with or without locale/lang at the end - the same.

oh weird you don’t have a settings editor button. Probably need to upgrade your Discourse.

did you refresh the page after changing the settings?

FWIW, here are my settings on my dev local Discourse install. I edited the default settings for the first one that goes to Meta, and also added one to my FAQ page just to make sure non-default ones work.

Meta, will open in a new tab to Discourse Meta, https://meta.discourse.org, vdo, blank, remove
Most Liked, Posts with the most amount of likes, /latest/?order=op_likes, vdo, self, keep
Privacy, Our Privacy Policy, /privacy, vdm, self, keep
FAQ, Frequently Asked Questions, /faq, vdm, self, keep

Here is the result with a test user (non admin).

As a word of advice, I would limit the number of links to one or two for mobile view. That header gets crowded awfully fast in mobile/ small screen views, especially for anonymous users with the login/sign up buttons.