Skip to content

Commit ac4a87a

Browse files
committed
TRAC-296: fix(footer) - Respect blog visibility setting in footer nav
Footer "Navigate" section listed every page returned by content.pages without checking isVisibleInNavigation, so the Blog link always showed even when Blog visibility was turned off in Control Panel. Fetch isVisibleInNavigation on each page node and filter hidden pages out before rendering nav links. Fixes TRAC-296
1 parent 6184ef2 commit ac4a87a

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

core/components/footer/fragment.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export const FooterSectionsFragment = graphql(`
4242
node {
4343
__typename
4444
name
45+
isVisibleInNavigation
4546
... on RawHtmlPage {
4647
path
4748
}

core/components/footer/index.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,12 @@ export const Footer = async () => {
124124
},
125125
]
126126
: []),
127-
...removeEdgesAndNodes(sectionsData.content.pages).map((page) => ({
128-
label: page.name,
129-
href: page.__typename === 'ExternalLinkPage' ? page.link : page.path,
130-
})),
127+
...removeEdgesAndNodes(sectionsData.content.pages)
128+
.filter((page) => page.isVisibleInNavigation)
129+
.map((page) => ({
130+
label: page.name,
131+
href: page.__typename === 'ExternalLinkPage' ? page.link : page.path,
132+
})),
131133
],
132134
},
133135
];

0 commit comments

Comments
 (0)