I’m sending on behalf of my client. This is a general question about navigation and I can’t send the url since the site is not ready.
We are using ghost 3.40.1, ghost-hosted.
Is there any way to have items in my navigation that display depending on whether they are published or not? It’s a bit of a headache to remove a menu item, unpublish the doc, then I have to re-add the item later on. I’d rather just leave the items in, then they will hide if unpublished.
No, you can’t set any condition in single nav links
Umm? Not sure what you’re asking.
He was saying it’s not possible to conditionally control (e.g. if it’s published) the navigation menu [from handlebars].
- All of your pages that are linked from the navigation should have a
- In your navigation area, use the get helper to fetch all published pages with the
- Output the result of 2 as a script tag (e.g. final result should look like this:)
window.activeNavItems = ['slug-a', 'slug-b', 'slug-c'];
- Create a script that loops over the navigation elements and removes an element if the link isn’t in the
Thanks, I appreciate it…will look into that.