Jiveabillion
-
7/23/2012 9:13:49 AM
RE:How to Add/Edit Widgets like using the Page Tab but with the API?
Thanks Jan,
I do understand why it does what it does. It makes perfect sense to me. I just didn't know about the "Reset to Default" button. I still can't find that button. Could you describe where it is or show me a screenshot?
It doesn't sound like that button does exactly what I want (I'll test it when I find it). If it removes all of the Page's widgets from all of the web part zones and inherits them from the template, that isn't exactly what I want. I need more control than that. I want to either be able to choose which widget zones to clear out and inherit or to make it so that Reset to Default button only resets widget zones where I have removed all of the Page's widgets.
I have made a web part with a button in it that will remove the references of empty widget zones for the current document when I click it, which then causes the templates widgets to appear. I can turn this into an AJAX call to a web service that will refresh the page on callback so I can inject a button somewhere in the interface without changing any of the CMS's code.
The problem is, I am using regular ADO.Net to query the database, modify the XML for the DocumentWebParts column and then ADO.Net again to update the database, which does not use the Document Workflow and does not create a new version of the document so that it can be undone if necessary.
This is why I need to know how to use the API to modify the widgets on a document. So, if you know the answer, could you please answer the first part of my earlier question?
Thank you!
|