We often use key text fields for simple strings in our content. Today we came across an issue where we store HTML for an email template (the Rich Text field doesn't provide enough of the formatting we use so it cannot be used in this instance).
We have some placeholders in that email template for various user fields and custom per-user links e.g
<a href="{signup_link}">Click here</a>
Although this is saved correctly first time, once published and you go back to the page the ="{signup_link}" is stripped out from the editor, and if you then save again that content is lost entirely. We tried various workarounds for this (including <a {signup_link}> and various others) and all got stripped out.
This feels like a bug as it saves correctly first time (and retrieves fine from the API)?
Is this happening inside the documents of your Prismic repository or your application?
Could you show me a visual example? A screenshot or screen recording.
I recommend that you switch the Key Text for a Rich Text field. It allows much more formatting options. And for this specific case, you can paste this piece of code inside a preformatted tag. It'll be returned in the following form in the API:
Thanks for getting back to me. We explicitly don't want any formatting for this field - it is essentially the HTML for an email template with some placeholders embedded.
In most cases a Key Text field works as you'd expect for this, other than this odd behaviour in the editing screen in Prismic.
In the end we had to use a Rich Text field for this, not allow any tags apart from paragraphs, and reconstruct the plain text string at the website end from the result, which is not ideal.
If there are good reasons to restrict what can be entered into a Key Text field perhaps another, simpler Plain Text field could be added that didn't have this restriction?
Pau
closed , flag & select 'Something Else' to reopen.
12
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.
We use a content type 'Corporate Newsletter Sign up' to deploy a Microsoft Dynamics Form Embed Code. We use the ' key text ' field to save the code snippet.
The original code snippet looks like this:
As soon as we save the localized content the code snippet is displayed incorrectly. Attributes in Div Containers are automatically removed. The Code looks like this:
The original code is saved in the content and deployed accordingly, but the shortened code snippet is displayed incorrectly and also used when we copy the content to another locale, which leads to the code embed not working in that other localized version.
Can you look into this? Maintaining our content is hard enough as it is and quirks like this are hard to keep track of.
Hello everyone, we released a fix for this issue. If you don't see it reflected on your repository yet, please send us a message with the URL of your repository so we can manually.