Place custom fields in collection meta?

default discord avatar
David
7 months ago
6

Do we have access to the

collection-edit__meta

as a custom

admin: { position: ... }}

?



I'd like to add a custom "Preview URL" and "Published URL" link/label to the bottom right collection meta...



Currently, it looks like I can add this to the

sidebar

... but I'd like to use the bottom right meta instead.



Also, is it possible to set a position weight for items in the sidebar, so that items can be placed above/below other items ... when using plugins to introduce fields to collections, it's hard to keep the order of items synchronized.

  • discord user avatar
    dribbens
    Payload Team
    7 months ago

    It would be nice to have more control on the meta like you're saying. I would open a github discussion as a feature request. I think others would be interested in this as well. We have the

    admin.position

    property, it could be extended to push fields to meta I would think.



    As for ordering fields, they just come in the order that they appear in the config. I'm unsure why you would need a

    weight

    property instead.

  • default discord avatar
    David
    7 months ago

    @dribbens if I modify the collection via a handful of plugins, and then also add fields to the collection config itself ... it becomes a pain to figure out where my field is going to be placed.



    Say for example I have two plugins which automatically attach fields to every collection in the sidebar ... then in a specific collection I want to add a couple fields to the sidebar, but I want the first sidebar field on the top, and the second on the bottom ... with my plugins sidebar fields in the middle.



    Plugin 1 - "user history", which adds fields for "Created By" and "Updated By"


    Plugin 2 - "slugs" which adds auto-generated slugs to my collections


    Collection A - adds a relationship to my image uploads to the sidebar, and also adds a relationship to a Categories collection, and a Tags collection



    I'd like to have the Category and Tags on the top, the Slug, the Featured Image, then Created By and Updated By



    This is a bit of an acrobatic feat with the current "in whatever order they were added" solution - a simple weighting system would allow me to prioritize the sidebar items and they could then be sorted by this ... using a simple default of say 10 or 20 for fields that don't explicitly specify the weight, allows for other fields to go before or after them easily

  • discord user avatar
    dribbens
    Payload Team
    7 months ago

    I definitely see your point! I'm considering how we should go about this.

  • default discord avatar
    Tinouti
    6 months ago

    Hi folks! I was actually just looking into how I could do just that, but sounds like this isn't yet a possibility, is that correct?


    Should we create a feature request for it on github? 👀

  • discord user avatar
    dribbens
    Payload Team
    6 months ago

    @Tinouti That would be a big help. We bump feature requests to the roadmap this way.

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.