Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Make home page or "/" a custom component (3.0)

default discord avatar
ocheezyylast year
3

Hey! I have a payload 3.0.0-beta.111 app that was created with the website template using sqlite.



I have a custom react component in "./src/app/(frontend)/marketing". If I wanted to make that my home page what would I do?

  • default discord avatar
    opie6446last year

    If I’m not mistaken, due to [Nextjs

    dynamic routing](https://nextjs.org/docs/app/building-your-application/routing/dynamic-routes) having

    marketing` dir would result into it being in the url.


    Maybe introducing a [route group](

    https://nextjs.org/docs/app/building-your-application/routing/colocation#route-groups

    ) as done here in this example, would help you achieve that.



    https://github.com/payloadcms/public-demo/blob/master/src/app/(pages)/%5Bslug%5D/page.tsx
  • default discord avatar
    diadamalollast year

    src/app/(frontend)/page.tsx

  • default discord avatar
    ocheezyylast year

    Hey

    @754097374640734239

    I appreciate you replying! I do understand the app router on NextJS and know that due to the fact that my

    page.tsx

    is inside of the

    marketing

    dir it will only render if I navigate to

    /marketing

    .



    @366641026410086401

    If I flatout replace that component it's not going to break the entire flow for routing after I create pages in the admin panel?

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.