Next.js Discord

Discord Forum

Dynamic Titles for pages - NextJs 14.

Answered
Peterbald posted this in #help-forum
Open in Discord
PeterbaldOP
I'm new to NextJs and am using version 14. I am building a website and would like to create dynamic titles for the pages of the website. My pages are inside project_root\app\pages\page_name\page.tsx. What will be the best approach to do it?
Answered by Northeast Congo Lion
View full answer

10 Replies

Northeast Congo Lion
generateMetadata()?
Northeast Congo Lion
Answer
PeterbaldOP
Thanks, I managed to solve this.
@Peterbald Thanks, I managed to solve this.
How did you solve it?
PeterbaldOP
as mentioned by @Northeast Congo Lion, by using generateMetadata function.
I have another query. I want to access the metadata or some parameter of the page in the RootLayout. How can I do it?
as its already a different query
PeterbaldOP
ok