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.

meta.ogImage not working

default discord avatar
snailedltlast year
3

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 is the root of the project. / is the root of a turborepo)
apps/
|.. web/
   |.. app/
   |.. payload/
      |.. payload-config.ts
   |.. public/
      |.. favicon.ico
      |.. icon.png


After restarting the app it now works on the login page, but it still shows the payload logo in the top left corner after logging in

Edit:


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

  • discord user avatar
    seanzubrickas
    last year

    Hey

    @290479081865084929

    to confirm - did you follow this guide when setting up your login image and dashboard icon?



    https://payloadcms.com/blog/white-label-admin-ui

    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, }, }
  • default discord avatar
    snailedltlast year

    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.

  • discord user avatar
    seanzubrickas
    last year

    Not a problem! We're around if you need further assistance here.

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.