I'm unable to set a meta ogImage in my NextJS Payload app based on the next-payload-demo repo. ogImage doesn't work, but favicon does, any ideas why that is?
The config looks like this:
export default buildConfig({
admin: {
components: {
beforeDashboard: [BeforeDashboard],
},
meta: {
titleSuffix: "- Grønn Vekst",
favicon: "/favicon.ico",
ogImage: "/logo.png",
},
},
// ... the rest of the config
});
The folder structure is as follows :
apps/
|.. web/
|.. app/
|.. payload/
|.. payload-config.ts
|.. public/
|.. favicon.ico
|.. icon.png
I was testing with two different apps, and it's working in the other app, but not the one this thread is about. Anyways, this is what the login page should look like
Hey @snailedlt to confirm - did you follow this guide when setting up your login image and dashboard icon?
can you show me both payload configs? it is curious why one works and the other doesn't. Wondering if it has something to do with the order of compeonts coming before your meta properties
Here's a simple example of how we typically do this
export default buildConfig({
admin: {
meta: {
titleSuffix: '- Hope Network CMS',
favicon: '/assets/favicon.png',
},
components: {
graphics: {
Logo,
Icon,
},
}
I misread the documentation and for some reason thought that the graphics components were only if you wanted more control over the size and position of the logo... so my config only has the admin.meta stuff, not the components.
Turns out this is another PEBCAK 😅
The reason one worked was because I had two projects open at the same time, and accidentally showed the wrong one. Another case of PEBCAK.
Sorry about the trouble :/
I'm currently working on other stuff, but since this is most likely solved by just following the docs correctly I'll close as solved and re-open if it turns out to not work when I get around to testing it again.
Not a problem! We're around if you need further assistance here.
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.