I have a migration where I need to modify some data in a blocklist. My plan is:
Get a list of all IContent with the blocklist on it.
Find the relevant widget in the blocklist.
Modify the widget.
Save the IContent.
I already have a complete list of IContent with the blocklist, but I cannot figure out how to deserialize the blocklist, and then I would have to serialize it at the end too, before saving.
Update block in migration
I have a migration where I need to modify some data in a blocklist. My plan is:
I already have a complete list of IContent with the blocklist, but I cannot figure out how to deserialize the blocklist, and then I would have to serialize it at the end too, before saving.
Maybe I am going about this the wrong way?
Any help would be appreciated.
Hi Allan
Sounds the right way!
There are some docs here: https://our.umbraco.com/Documentation/Fundamentals/Backoffice/Property-Editors/Built-in-Property-Editors/Block-List-Editor/#creating-blocklist-programmatically
but also this gist from Dan Diplo might be really helpful:
https://gist.github.com/DanDiplo/1e8e4dcd93bcc29115ef16c62e3d090a
regards
Marc
is working on a reply...