Organize collection in folders/groups

default discord avatar
lucaceck95
3 months ago
8

Hi everyone, i started to build my website with payloadcms, and i can say that it's a great product.


i'm looking for a way to organize my collections.


i'll explain...


now collections are organize in a single "folder"


collections


|---- collection1


|---- collection2


|---- collection3


|---- collection4


|---- collection5



is there a way to organize in subfolders like this


collections


|---- folder1


|---- collection1


|---- collection2


|---- folder2


|---- collection3


|---- collection5


|---- collection5




let me know 😉

  • default discord avatar
    .bakry
    3 months ago

    mention me if you find a solution 😆

  • default discord avatar
    kalon_robson
    3 months ago
    https://payloadcms.com/docs/configuration/collections#admin-options

    Not sure if this is what you are looking for. The first option "group" allows you to group collections together and have them split and labelled in the navigation. I don't think it allows you to nest groups however, you may need to put in your own custom component for that

  • default discord avatar
    generator101
    3 months ago

    have you tried creating index.ts file in folder1



    export { default as Collection1 } from './collection1'


    then you can do something like this



    and in the index.ts add all your sub collections



    in payload config file, add them like this

    import { Collection1, Collection2 } from './collections/folder1
  • default discord avatar
    lucaceck95
    3 months ago

    That's what i mean! I'll check It out

  • default discord avatar
    kalon_robson
    3 months ago

    Whoops, totally misread the requirements of the OP there. Apologies.

  • default discord avatar
    lucaceck95
    3 months ago

    guys... you can call me "dumb"


    adding

    admin.group

    in collection was enough...



    I probably don't know how to explain myself well to be understood

    :painwithcoffee:


    https://payloadcms.com/docs/configuration/collections#admin-options


    it can be a nice idea to have nested groups...maybe

  • discord user avatar
    denolfe
    Payload Team
    2 months ago

    Organize collection in folders/groups

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.