Bard field "not working" (still in array format) in custom Tag #4579
Replies: 3 comments 3 replies
-
What about if you return from the tag like this? return $entries->map(function ($entry) {
return $entry->toAugmentedArray();
}); Does that return what you're looking for? (fyi: to do codeblocks you need to use three backticks at start and end, not just one) |
Beta Was this translation helpful? Give feedback.
-
Hi, yes – thats what I also looked into.
My structure looks the same. I even managed to wrap it into an Entry:
Still no difference. But I think I found the main difference when i dump the values in the antlers template.
I cannot even dump the values of my custom tag. It throws this error: I also tried to extend not the My guess is that I'm breaking somehow the functionality when im cutting out field of the data, not returning the entry but rather subfields.
|
Beta Was this translation helpful? Give feedback.
-
Hi, i rebuild a test scenario and went through it line by line and I found a fix – but I'm missing explanation or a more straight forward approach. The flatMap did break it. map() was also enough for what i needed. I wrap it as Entry but I needed to set the correct collection and field attribute, without it its not working:
I'm assuming that it can resolve the bard field, since the information how to resolve fieldtypes is related to the collection (and most properly their blueprint). I'm still curious if there is a better way to do this. |
Beta Was this translation helpful? Give feedback.
-
Hi, I'm having some issues with bard field content when using a custom tag.
In my custom tag I'm extending Statamic\Tags\Tags; but I've also tried to use Collection
I'm using it like this
From the docs im guessing that its related to the Bard Augmentor and ProseMirror Rendering, but i don't know if i need to add this to my rendering method, or if its easier to just extend a Class that already works with the bard field.
Thanks for any input on this topic
Beta Was this translation helpful? Give feedback.
All reactions