I have a collection Posts with a field slug. No matter what I do, the slug field will not go to the sidebar position.
If I copy and rename the same collection, the field will be in the sidebar. I tried dropping the posts collection from the database and re-creating it, but the outcome is the same.
Any ideas how I could solve this and not have to rename the collection to something else
Are you sure there is only 1 slug field on that collection?
What happens if you rename the
name
of your slug field?
Yes, there is one slug field. I renamed it, outcome is the same.
I tried to add another field to the sidebar, it also didn't change the position.
Is layout data persisted somewhere perhaps?
rm your dist and build folders just be sure
then stop/start dev server
Huh, that also didn't solve the issue. I also tried dropping the _preferences collection from db.
Perhaps any other ideas?
are you sure you are at the right url?
something is definitely up, since you changed the field name and it did not appear
do you have 2 collections with the same slug?
Yeah, I only have one "posts" collection. Double checked if i had a duplicate by mistake.
If I copy/paste the same collection config to a new collection, fields will move to the sidebar in the new one.
I don't think having a block named 'posts' could cause any collisions? This block is also not being used in any field inside posts collection
If I rename the field, the name will change, position doesn't
Short video of the issue
That is very odd
hmmmm
Should I open an issue about this? ๐
If you can pinpoint the issue
it's hard for me to tell if it is real, but if you want to give the slug thought a try that would be awesome
I will retry with a clean installation and see If I can reproduce it ๐
Thanks! Let me know if you find anything!
Will do, thanks for the help ๐
Just a quick follow up - I have installed a fresh payload instance but with same src/ contents and collections config. The fields are also not showing in the sidebar.
I will try to find if there is anything specific in my config that has an effect on this
If I uninstall SEO plugin, the fields position themselves in the sidebar.
you are on v1.0.13 of the seo plugin?
I am on version 1.0.14-canary.0
But I also tried installing the plugin from github source
I have found the exact circumstances where this happens.
1. SEO plugin is in tabbed mode
2. In the collection you don't have tabs or the fields you want in the sidebar are inside a tab
Workaround:
1. Have a single tab in your collection
2. Fields you wish to have in the sidebar must not be inside the tab but after the tab field
Like this:
Yup you got it right
@881462909199331358!
actually added something in the readme about this ๐ :
If you wish to continue to use top-level or sidebar fields with tabbedUI, you must not let the default Content tab get created for you (see the note above). Instead, you must define the first field of your config with type tabs and place all other fields adjacent to this one.
Ah, wish I had seen this sooner haha ๐ Thanks for the reply, it does make sense.
I would suggest maybe adding this to the docs for tab field? It took me some time to figure out it was the SEO plugin causing this
Anyhow, I'm loving payload so far, especially the block field ๐
It really only is a quirk of how this plugin operates, so I don't think this has a place in the main payload docs.
BUT now that you mention it, I do think we could point out in the
Fields > Overview > Admin config > position
docs that this only works when the field is defined at the "root" level of a collections' fields config.
What do you think
@808734492645785600?
(I'd make a PR for it, but I'm pretty sure the way I'm explaining it and the terms I'm using aren't the right ones ๐ )
Star
Discord
online
Get dedicated engineering support directly from the Payload team.