Hey
@569873065152872479
Yes!
https://github.com/payloadcms/payload/tree/main/templates/pluginpnpx create-payload-app -t pluginOh look at that, thanks
@654031862146007055!
My pleasure!
you probably know this mate.
I want to create some fields in the plugin (will be a sitemap plugin) so users can specify:
- Priortiy
- If it should appear in the sitemap.
For each page.
But don’t want to just put it in all of their collections, was thinking about how I can open it up to users so they can do it themselves, I.e put it in the side bar etc.
Does payload offer this flexibility already? Feel like seo plugin does. Don’t know if you have any source code that’s handy.
So, realistically, this would be most straightforward if you actually just appended a few fields to the target collections as specified in your plugin config
A user enables this for collection with slug "pages", plugin appends some fields, everything is good
If you are
opposedto this, then my next thought would be something along the lines of what plugin-search does
And that would be a hook to create a sitemap index doc in a distinct collection
And then a hook for deletions
Yeah I thought just appending a couple of fields would be best to start of with but don’t know if users would be annoyed with fields floating around.
Second option is very intriguing. I’m trying to think what people would find better 🤔
Both will work, but option 2 is a little more work for you I think, you have the overhead of maintaining hooks that should manage create/update, and delete
True true, I’ll go with keep it simple.
Thanks 🙏 will share a link when it’s done.
Going to make it very similar to Strapis one.
Star
Discord
online
Get dedicated engineering support directly from the Payload team.