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

default discord avatar
iamlinkus
last month
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 ๐Ÿ˜ฆ

  • default discord avatar
    Alessio ๐Ÿฃ
    last month

    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
    last month

    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!

  • default discord avatar
    Alessio ๐Ÿฃ
    last month

    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
    last month

    Yup, already on it. ๐Ÿ™‚



    Done:

    https://github.com/payloadcms/payload/discussions/2447
  • default discord avatar
    Tinouti
    last month

    As a temporary hack, you could just add some css. ๐Ÿ˜Š


    #nav-group-Pages { order: -1 }
  • default discord avatar
    Alessio ๐Ÿฃ
    last month

    hah didn't think of that. Smart idea!

  • default discord avatar
    TheDunco
    2 weeks 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.