I’m working on the editable preview of a custom block with structured field content. Everything works fine except the available marks of writer fields in the preview remain the default ones. Is there a way to display the exact set of marks in the preview which are assigned to the field of a structured field via blueprint? Something like :marks="item.text.marks"
doesn’t work. Thanks in advance!
Hi Sascha, Could you please share your code/blueprint - I’ll need a bit more context to see where it’s going wrong/where the gap is and if it can be closed.
Hi Nico,
you can simply check out the linked faq example from the docs and the corresponding blueprint and change the marks of the answer field from marks: true
to something more specific, like:
marks:
- link
- email
This changes the available marks in the block dialog as expected (to only link + email) but the preview still shows all default marks for the answer.
Seems to work for me. That’s why I asked for your actual code, so to see what might differ to when I am trying it.
Yeah, it works with a single writer field but not with the linked faq example with structured field content. Used that basic example just to see if was my code but it also happens here.
So in the template code of the Vue component you’ll find two k-writer
wrapped in a details
tag. They currently have manually set :marks='false'
and :marks='true'
. Better is to actually pass the options from the fields. So
:marks="field('faq').fields.question.marks"
and
:marks="field('faq').fields.answer.marks"
Will put in a PR to update the guide.
Yes, that’s what I was looking for but had no clue how to pass the options. Works like a charm.
Thanks a bunch, Nico!