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.

Is there an easy way to move an admin group (globals) to the top?

default discord avatar
iamlinkus2 years ago
7

I have set up page content as globals for each page, and I need the "Pages" group at the top of the sidebar. Is there a way I can easily move it to the top? Moving the globals declaration in payload.config above collections doesn't work 😦



ChatGPT is giving me fake answers 😦



Still can't figure it out without writing my own component for the sidebar 😦

  • discord user avatar
    alessiogr
    2 years ago

    looking into it rn!



    @688437818019938326

    so it seems you can make sure globals are at the top if you put the collections in a group, and make sure the globals are not in a group



    Other than that tricky, because all collections are generally added first:

    https://github.com/AlessioGr/payload/blob/bab34d82f5fddad32ceafd116ad97e87cab4c862/src/admin/components/elements/Nav/index.tsx#L50

    and the groups are iterated over only after all collections were handled



    might need to be a feature request to be able to customize the position of them better

  • default discord avatar
    iamlinkus2 years ago

    Yeah, I tried that, but then the "group" defaults to "Globals" which is misleading for our clients and we're usually adding one other group for globals which includes footer/header/seo/etc.



    thanks for looking into it, though!

  • discord user avatar
    alessiogr
    2 years ago

    Yea it's not optimal. Havent found a better hack though.



    You could post it in GH Discussions and mark it as feature request there!

  • default discord avatar
    iamlinkus2 years ago
  • default discord avatar
    tinouti2 years ago

    As a temporary hack, you could just add some css. 😊


    #nav-group-Pages { order: -1 }
  • discord user avatar
    alessiogr
    2 years ago

    hah didn't think of that. Smart idea!

  • default discord avatar
    thedunco2 years ago

    I'm actually having the opposite problem! I want my Globals to show up below my Collections but either way (if I do or do not provide a

    group

    property) Globals are appearing at the top of the nav bar in Payload v1.8.2.

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.