Replies: 4 comments
-
OK, I can do it with the <script setup>
const { data: navigation } = await useAsyncData('navigation', () => {
return fetchContentNavigation(queryContent('/articles'))
})
</script> But I get a filtered list rather than the sub navigation. |
Beta Was this translation helpful? Give feedback.
-
Related PR for the error #1156 You may need to access the children from navigation <template>
<ContentNavigation v-slot="{ navigation }" :query="catsQuery">
<NuxtLink
v-for="link of navigation[0].children"
:key="link._path"
:to="link._path"
>
{{ link.navTitle || link.title }}
</NuxtLink>
</ContentNavigation>
</template> |
Beta Was this translation helpful? Give feedback.
-
While your solution works, it quickly becomes error prone with new content added. Besides, if the directory structure has multiple nested folders, it becomes even more fragile to maintain for bigger projects. Having a way to only get the current navigation based on the queryContent result would help. As an example, when querying
|
Beta Was this translation helpful? Give feedback.
-
the same question. |
Beta Was this translation helpful? Give feedback.
-
Hi! I have the following content structure:
I want to fetch the navigation of all articles and looked at the example here: fetchContentNavigation(). However, it does not seem I can get the navigation of a sub directory.
I tried this without success:
I have the following error:
I see in the code base that this is supported.
Thanks for your help.
Beta Was this translation helpful? Give feedback.
All reactions