Add custom data to blocks #7083
Unanswered
teradrive65k
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everybody, I want to add some custom data to my blocks in sulu, but these data is not present in the original XML file. For exemple by using the headless cms bundle I have a response like this:
It's fine but I want to add a property "id" in my json for each block , something like this:
How can I add this "id" property ?
For now I get the content in the headless controller and then I add the id by hand by looping recursively on all my data, but I find this very heavy. If I can do it at start it will be better. The issue that I don't know how ? Can I get the object somehow and add this value before the json response ? Do I have to save this property in the database ?
Thanks for the help.
Beta Was this translation helpful? Give feedback.
All reactions