AngularJS in block editor?
# help-with-umbraco
j
Reading a blog post from this year about creating custom block grid editors. I was a bit surprised to see that they still use AngularJS, I thought Umbraco was replacing that in like version 13? https://umbraco.com/blog/deep-dive-block-grid-editor-part-2/ Would you still use angular for this?
s
For now it's the only option... ETA on the new AngularJS-less backoffice is version 14 (H1 2024)
j
Ok, but I think support for the old grid editors will cease to exist in version 13? Does that men we have to write all our components in the new block grid with angular and then have to update them in version 14?
s
IIRC the old grid is still in v13, but you should definitely not use it if you can avoid it. You don't need to use AngularJS to use the new block editors - only if you need custom views in the backoffice for the blocks.
j
ok, we have a site with heaps of custom grid editors, but I guess we won't create new ones then in a while. Thank you very much for your quick response!
s
What does your custom grid editors do? If they are just a bunch of properties the editor can fill with content, then that is what Block List/Grid does out of the box.
j
Maybe it is possible to use existing blocks, could be more of layout stuff, have to check deeper. What custom stuff do you think is requiring custom blocks?
We have for example some editors where we list for example news items from a news node and editors may select some of them to be presented on top etc. We have similar "property lists" for employees on a contact page etc.
s
Ok, that sounds like something you would do as a content picker property (contentment maybe) on the top block (if even it needs to be in the bl/bg?)
j
Do you know if existing components (app_plugins grid editors) can be place in hte new block grid? If it is possible to mix new and old ones?
h
you wouldn't require any custom angular for this.
s
block grid is basically just a list of "content" based on the content types that is allowed. As long as you can "compose" your custom grid editor as a content type, you don't need anything custom.
And iirc you can't do custom blocks like that
j
ok, I guess I have to give blocks a try and see what is possible and not in our case. Great thanks for your help on this!
h
Lots of stuff possible 🙂 I replaced most of my old macro stuff using fairly simple blockgrid blocks too
j
But a bit confusing that the blog post covers angular if that is just needed in rare cases, don't you think?
h
Like skttl says, it depends on the complexity of your components and showing that in the back office for a consistant view between it and the front end ui
I can also recomend https://marketplace.umbraco.com/package/umbraco.community.blockpreview It uses your front end block views to render in the backoffice, so for most stuff you get a reasonably consistant view between both
s
I don't think so, it's part 2 of a series, and it specifically says that the custom views is only for further customization if you need it.