Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Elliott Brown 41 posts 211 karma points
    Nov 29, 2023 @ 21:33
    Elliott Brown
    0

    how can I modifying blockGridModel/blockGridItem as json during saving event?

    during a Saving event I'd like to access the setting values of a BlockGridModel and modify the BlockGridItems like I can with published content.

    When I access the content.getValue("myGrid") I get json, but there are no values available in this, just udi's. Unfortunately, these don't seem to return any values either.

    I can achieve what I want with IPublishedContent because I can iterate over the blockGridItems within the BlockGridModel and get what I need from the settings. However, what I really want to do is equivalent during a saving event working with the json.

    Any ideas, I've spent far to long on this, lol! Thank you inadvance!

  • Huw Reddick 1929 posts 6697 karma points MVP 2x c-trib
    Nov 30, 2023 @ 10:57
    Huw Reddick
    0

    Hi Elliott,

    Maybe take a look at the code here https://github.com/rickbutterfield/Umbraco.Community.BlockPreview

    There are some services that probably do what you are trying.

Please Sign in or register to post replies

Write your reply to:

Draft