I've got an Ektron widget that has global settings and local settings which can override them. I need a way to programmatically read the global settings in the widget itself because depending on user input I need to reset the values to what is stored globally.

Is there an API method to read the global settings of a widget? I saw this question that shows how to read the instance-level settings by getting what is stored in the page XML, but that doesn't give me what is stored at the global level.

Load Ektron widget by ID?

有帮助吗?

解决方案

I was able to accomplish this by using the Ektron.Cms.Widget.IWidgetTypeModel.FindByID() method.

var widgetTypeModel = new Ektron.Cms.Widget.WidgetTypeModel();
Ektron.Cms.Widget.WidgetTypeData widgetTypeData = null;
widgetTypeModel.FindByControlURL("Widget.ascx", out widgetTypeData);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top