# Mega Menu - NextJS in 2024

**URL:** <https://community.prismic.io/t/mega-menu-nextjs-in-2024/16110>\
**Category:** Developing with Prismic\
**Tags:** nextjs, graphquery\
**Created:** [June 11, 2024, 3:46pm UTC](https://community.prismic.io/t/mega-menu-nextjs-in-2024/16110 "2024-06-11T15:46:21Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Phil](https://dub1.discourse-cdn.com/flex013/user_avatar/community.prismic.io/phil/32/14_2.png) [@Phil](https://community.prismic.io/u/Phil)\
**Post date:** [June 12, 2024, 9:07am UTC](https://community.prismic.io/t/mega-menu-nextjs-in-2024/16110/3 "2024-06-12T09:07:41Z")

</div>

Hi Joel,

I answered that here:

> [@Mega menu](https://community.prismic.io/t/mega-menu/15111/9):
>
> In your Next.js page or layout component, you can fetch the layout data. You'll likely want to make this query in your layout component or in each page component, depending on your architecture. Here's how you might fetch the layout data, including handling variations for menu items with and without sub-menus: import { client } from '../prismicio'; export async function getLayoutData() { const layoutData = await client.getSingle('layout', { graphQuery: `{ layout { ...layou…

You mentioned this didn't work for you. What exactly doesn't work? Do you have examples or error messages?

Thanks/

---

_[View the full topic](https://community.prismic.io/t/mega-menu-nextjs-in-2024/16110)._
