Good day
I am struggling to change the title of my e-commerce application from "Payload E-Commerce Template" to "<My custom name>. Normally in NextJs, we would find this on the "Layout.tsx" page where we would then change the title then description of the site. Upon looking at the "Layout.tsx" file under the src/app folder I was not able to find the "Title" and "Description" options.
Is it possible to receive direction on where I would be able to change the title?
Kind Regards,
Ayanda Vilakazi
Junior Full Stack Developer
Hello! You can find it in here:
https://github.com/payloadcms/payload/blob/main/templates/ecommerce/src/payload/seed/home-static.ts#L27
The contents of the homepage are not hard-coded -
all contentcomes from payload, including the "Payload E-Commerce Template" title.
By default, if you do not have a home-page set up inside of Payload, it will use the home-static file as data for the homepage
okay thank you so much
You're welcome!
For extra clarity, also check out this file:
https://github.com/payloadcms/payload/blob/main/templates/ecommerce/src/app/(pages)/%5Bslug%5D/page.tsxThat is the page Next.JS loads when you open your website. You can see in line 22, the slug is set to 'home' by default.
Then in line 43, it uses the home-static.ts data as data for the page if no slug with name 'home' is found in payload.
And finally, it returns the
<Hero
and
<Blocks
components, which basically render the data dynamically
That's probably the logic you were looking for - it's not in the
layout.tsx
, but in
(pages)/[slug]/page.tsx
thank you so much for your help!!
Star
Discord
online
Get dedicated engineering support directly from the Payload team.