Copied to clipboard

Flag this post as spam?

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


  • AbsolutelyN 85 posts 433 karma points
    Jan 19, 2021 @ 12:18
    AbsolutelyN
    0

    Doc Type Composition in Block Editor?

    Hi

    I'm building my first block editors and have run into a problem that some of the settings for my blocks break down into regular groups. So I've create a couple of common settings doc types and re-use them on various block settings.

    When I do this I cannot get the settings to save of any doc type other than the first one.

    First doc type (Image Settings) saves fine. Second one (Advanced) does not save at all and is not passed to BlockListItem when rendering: first doc type (Image Settings) saves fine. Second one (Advanced) does not save at all and is not passed to BlockListItem when rendering

    The json value does not include the second composition properties. And when you try to render on front end settings with GetBlockListHtml the setting seem to be null.

    {
       "layout":{
          "Umbraco.BlockList":[
             {
                "contentUdi":"umb://element/8bea306ead694002b495242684be34a2",
                "settingsUdi":"umb://element/54b2d93f83e9484aaccf373ac4bca4b3"
             }
          ]
       },
       "contentData":[
          {
             "contentTypeKey":"97af064b-37d0-40e6-b0aa-04ae99feb24c",
             "udi":"umb://element/8bea306ead694002b495242684be34a2",
             "images":"umb://media/bdd7fb1813824c70bba1218d46d6e6b6,umb://media/217cd1fc1bb54a58b2e6d3cc4cfe2db4,umb://media/dd01edadee1140d2adbf2354656aeffa"
          }
       ],
       "settingsData":[
          {
             "contentTypeKey":"6262abee-cc52-4702-a413-0a64fbc3c20a",
             "udi":"umb://element/54b2d93f83e9484aaccf373ac4bca4b3",
             "crop":"3",
             "cropMode":"3",
             "enableLightbox":"1"
          }
       ]
    }
    

    The doc types here are one for the block editor settings, this has no properties - just two compositions.

    Is it possible to use doc type compositions with Block Editors? Hopefully missing something obvious. Many thanks for any input.

    Using Umbraco 8.10.1

  • AbsolutelyN 85 posts 433 karma points
    Jan 19, 2021 @ 14:45
    AbsolutelyN
    100

    Solved:

    Thankfully a really simple solution. I had changed the doc type of an existing block. Content already made with it still worked but it only saved or updated properties that already existed before the change.

    The simple solution was to delete any content created before changing the doc type and add it again. Possibly one to watch out for if you add a new property to a block that's already in use.

    It had nothing to do with doc type composition which works fine.

Please Sign in or register to post replies

Write your reply to:

Draft