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

default discord avatar
iamlinkus
8 months ago
15

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
    Payload Team
    8 months ago

    looking into it rn!



    @iamlinkus 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
    iamlinkus
    8 months 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
    Payload Team
    8 months 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
    iamlinkus
    8 months ago
  • default discord avatar
    tinouti
    8 months ago

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


    #nav-group-Pages { order: -1 }
  • discord user avatar
    alessiogr
    Payload Team
    8 months ago

    hah didn't think of that. Smart idea!

  • default discord avatar
    thedunco
    6 months 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.

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.