Customising the Bard nodes #7743
-
The Bard functionality is excellent and the best block editor experience I've seen around. I wonder how hard it would be to introduce the possibility of customising the preview content in the collapsed node? Ideally it would be great if you could grab the node content and transform it into some html, for example if the node contained an image, I could chose to display it as a small icon. If it's a timeline like above, I could grab a few entries and display those in a compact nice way. In the most elegant solution we could even remove all the standard styling and render it almost wysiwyg wise (clicking it would still open up the standard view with fields, etc.) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @sptv2reg, Having a full-fledged and maybe even rendered preview is not (yet) possible. Not the most elegant solution but it works. And those "Bard nodes" you're referring to are sets of fields inside of the Replicator fieldtype. So in your case you might have a -
handle: title_text
field:
replicator_preview: false
# ...
-
handle: subtitle_text
field:
replicator_preview: false
# ...
-
handle: image
field:
replicator_preview: false
# ...
-
handle: replicator_preview_text
field:
input_type: text
type: text
display: "Replicator preview"
instructions: "The text you want to display for the Replicator preview." That would look something like this: There are a few issues in the statamic/ideas repo related to this.
Hope that helps :) |
Beta Was this translation helpful? Give feedback.
Hey @sptv2reg,
Having a full-fledged and maybe even rendered preview is not (yet) possible.
It's however possible to have a preview text by setting the
replicator_preview
tofalse
on all the fields and then have one text field that essentially works as something like thereplicator_preview_text
.Not the most elegant solution but it works.
And those "Bard nodes" you're referring to are sets of fields inside of the Replicator fieldtype.
So in your case you might have a
timeline.yaml
with a few fields inside.Set
replicator_preview: false
for all fields except for one text field like so: