-
Notifications
You must be signed in to change notification settings - Fork 787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating Block List Element on Client Side #6746
Comments
Thanks for the detailed report @zharonar ! The article you're referencing is currently being reviewed, as we've previously received reports that the guide outlined in the article no longer fits the current version of Umbraco 13. I'll do what I can to get the review of this article expedited. |
@sofietoft Thanks for the swift response. The issue occurs in the both code snippets, first is the copy paste from the code sample from the documentation, second snippet is our use of the code sample. The issue occurs in this line of code: |
We managed to get this stuff working for our use case. We fiddled with the implementation and reverse engineered the NOTE: Implementation is inside of NOTE: This is our constructor:
First we figured out what
Then we got our Afterwards as stated above, we got the hand of the internal functions and copied them into our controller:
These functions weren't inside of the
Now that we had our PoC code, we were ready to add the values:
We had a hard time figuring out, why we got the block elements visible, but without data even when we added it inside of To make it visible without saving first, I think the solution would be to make the rest of the internal functions inside of the |
So happy to hear that you managed to find a solution here @zharonar ! 👏 😄 And thanks a lot for all the details - I'll make sure these are forwarded to our developers when they take up this task 💪 |
What type of issue is it? (Choose one - delete the others)
Documentation not clear, code issue
What article/section is this about?
https://docs.umbraco.com/umbraco-cms/13.latest/extending/property-editors/build-a-block-editor
Describe the issue
We're trying to achieve creation of Block List Element programmatically, before document is even saved into the DB, because we need to call our API to assemble some data that we can pass into the Block List Element to structure it.
The issue we're occuring is with these lines of code, to try to create block entry, from the documentation sample.
It is not explained where
vm
comes from, where and what isumbVariantContentEditors
. We managed to achieve our model by getting it from this structure that we have in our angularJS controller.Code sample:
One of the issues is that we cannot have
scopeOfExistence
the way it is described in the documentation, since we do not know in our Controller context what scope we need.Therefore it is just injected
$scope
in our case...Another issue now occurs when we try to call
createModelObject
, as we mentioned, the data should fit the method, except we noticedpropertyEditorScope
is missing in this sample, and it is defined in method that we found at the following link:https://apidocs.umbraco.com/v13/ui/#/api/umbraco.services.blockEditorService
Calling
modelObject = blockEditorService.createModelObject(vm.model.value, vm.model.editor, vm.model.config.blocks, scopeOfExistence);
throws exception at the following line somewhere down the code:Summary:
Could you help us reach our solution with creating the block element via Client?
The text was updated successfully, but these errors were encountered: