When creating a custom type, if I add labels to my custom slice, they are being deleted and disappearing.
They still appear in the API response sent back. However I have to keep adding them back in the Custom Type builder tool and they do not appear in the UI.
then when I go into Documents I can add my custom type and initially I see the new labels.
However when I later come back to the custom type the labels have disappeared. They still exist in the API call however, so it looks like it is just the UI that is missing them.
The team just informed me that this is a known bug that's currently being tracked in our backlog. But here's a workaround in the meantime:
Create the Slice on a separate "Slice Making" Custom Type or Repository
Copy Paste its JSON definition directly in the JSON editor of the Custom Type you want to add it to
Another option would be to replace your Slice Labels with a drop-down select field directly in the Slice. That will be a more stable option. I realize that this induces a lot of work on your side, so you'll are the best to judge which approach would work the best for you
We hope one of these workarounds will work for your team
Pau
closed , flag & select 'Something Else' to reopen.
14
This thread is being monitored as an open ticket in the internal Prismic issue tracker. The Prismic support team will update this post as we get more information from our dev team. If you have a similar use-case, you can βFlagβ this topic to reopen and add it here.
I understand that this is frustrating, although this is not something that is likely to be fixed, it's more likely to be deprecated as it has been replaced by the Slice Variations feature using Slice Machine.
When you say "Disappearing data seems like a critical issue", the data doesn't actually disappear until the documents using the Slice have been republished, so if you re-add the label in the Custom Type the data will come back.
But slice variations aren't available using the regular API, right? It's only available if you are using slice machine with React. So any other framework isn't supported for this.
Or is there a way to use variations over an API with a static site generator like 11ty etc?
The problem with saying that it's simple enough for me or my team to do it. But once we hand this over to the client, they are not going to be able to use the CMS in the way we designed it to work for them. Meaning this will get flagged as a bug and we will be asked to fix it.
The whole reason we are using Prismic is so that a non-technical person will be able to create and manage the content. If this feature is deprecated, it would be good to know -- as we had no idea that was the case.
For now we'll figure out a work around.
In the meantime, is there any plan to support variations over the API or will this only be supported if we use specific libraries?
That's correct it's only available for react and vue users in terms of templating right now, the actual Slice (model) could still be built locally and sent to the Prismic repo with Slice Machine, this part is not technology-specific, it just wouldn't generate the code for you.
The Slice Labels feature isn't deprecated, if it was to be deprecated we would give everyone plenty of warning, the issue could be resolved when the team begins its overhaul on the editor. I don't have any confirmation on either of those things.
Issue:
The Slice Labels only disappear when a Custom Type is edited using the visual editor, this is because the Slice Labels can only be edited with the JSON editor. For the moment you'll need to remember to check Slice Labels after editing a Custom Type (I know this is frustrating). So when you hand the content over to the user they shouldn't need to make any changes in the Custom Types becuase it will need to be reflected in the code, so they won't lose their Slice Labels.
Solution:
The most reliable otpion is to use a Select Field as the first field in your Slice instead of Slice Labels. Your user can select what option they want using this field and the Select Field will never disappear as it is built using the Visual Builder. In your code you will use it the exact same way you use Slice Labels.