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.

Organize collection in folders/groups

default discord avatar
lucaceck95last year
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
    .bakrylast year

    mention me if you find a solution 😆

  • default discord avatar
    kalon_robsonlast year
    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
    generator101last year

    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
    lucaceck95last year

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

  • default discord avatar
    kalon_robsonlast year

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

  • default discord avatar
    lucaceck95last year

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

    Organize collection in folders/groups

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.