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 ๐ฆ
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
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!
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!
As a temporary hack, you could just add some css. ๐
#nav-group-Pages { order: -1 }
hah didn't think of that. Smart idea!
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
Discord
online
Get help straight from the Payload team with an Enterprise License.