We're in the process of migrating our CMS platform to Umbraco from a different vendor. We currently have many "widgets" which need to be re-created as Macros within Umbraco.
The complication we have is that our existing widget-editors are quite complex, and often have inter-related fields, ie if one option is selected from a field, then that affects the available options within the rest of the editor.
As an example, we have a Content Picker parameter, and after selecting a piece of content, we have a Media field which should be populated with a list of all the related Media items to that bit of content (some from within Umbraco - some from external cloud storage solutions).
So I guess I'm asking one of two things...
Is it possible to:
1) Write a complete custom widget editor view, rather than have Umbraco auto-create the editor from the list of parameters.
2) Subscribe to an event/broadcast from the Umbraco Content Picker field, so I could essentially hook into the 'Change' event of that field from a custom script that could then allow me to update my custom Media field.
I've had a look into the Umbraco content picker view (HTML), and can see that I could add the ID of the content into a data- attribute on the picker which I could potentially then use - but I was keen to avoid changing any core Umbraco code for maintainability/upgrade path reasons.
I hope this makes some sense to someone - apologies if a bit confusing and waffley - this is my first post in Umbraco forums!
Thanks so much for your response. EditorState looks like a really handy service to inject into a controller. However, when I step through it and look at the contents of the object, I'm only seeing properties that relate to the Umbraco Content item itself, not any details of the parameters of the macro i'm in the process of adding to the grid.
Any chance you could point me at a sample or similar of tracking macro parameter values using this object?
More complex-macro editors
Hi,
We're in the process of migrating our CMS platform to Umbraco from a different vendor. We currently have many "widgets" which need to be re-created as Macros within Umbraco.
The complication we have is that our existing widget-editors are quite complex, and often have inter-related fields, ie if one option is selected from a field, then that affects the available options within the rest of the editor.
As an example, we have a Content Picker parameter, and after selecting a piece of content, we have a Media field which should be populated with a list of all the related Media items to that bit of content (some from within Umbraco - some from external cloud storage solutions).
So I guess I'm asking one of two things...
Is it possible to:
1) Write a complete custom widget editor view, rather than have Umbraco auto-create the editor from the list of parameters.
2) Subscribe to an event/broadcast from the Umbraco Content Picker field, so I could essentially hook into the 'Change' event of that field from a custom script that could then allow me to update my custom Media field.
I've had a look into the Umbraco content picker view (HTML), and can see that I could add the ID of the content into a data- attribute on the picker which I could potentially then use - but I was keen to avoid changing any core Umbraco code for maintainability/upgrade path reasons.
I hope this makes some sense to someone - apologies if a bit confusing and waffley - this is my first post in Umbraco forums!
Thanks Tim
Comment author was deleted
Hey Tim and welcome to our :)
You might find EditorState handy in your case
http://umbraco.github.io/Belle/#/api/umbraco.services.editorState
If you inject that in your custom controllers you should be able to fetch values from other properties (and watch for changes)
Hi Tim,
Thanks so much for your response. EditorState looks like a really handy service to inject into a controller. However, when I step through it and look at the contents of the object, I'm only seeing properties that relate to the Umbraco Content item itself, not any details of the parameters of the macro i'm in the process of adding to the grid.
Any chance you could point me at a sample or similar of tracking macro parameter values using this object?
Thanks again,
Tim
is working on a reply...