Rotator with customizeable template
Hi all. I'm trying to build a Rotator control that is very similar to the built in List Control. The only difference is that it would use the ASP.NET Rotator control to scroll through the items in the list instead of showing them all at once.
I know there is a News Rotator sample with the SDK that gets me most of the way there. My real question is how to build the control such that the end user can write custom templates using the Sitefinity backend, just like you can do with the List Control.
Can someone point me in the right direction?
Hello Kevin,
If we tkae the News module, for example, when creating the News widget designer which inherits from ContentViewDesignerBase, we register the views in the AddViews() method, where the ListView is of type ListSettingsDesignerView and the DetailsView of type SingleItemSettingsDesignerView. For example:
var listSettings =
new
ListSettingsDesignerView();
listSettings.SortItemsText = Res.Get<NewsResources>().SortNews;
listSettings.DesignedMasterViewType =
typeof
(MasterListView).FullName;
var singleItemSettings =
new
SingleItemSettingsDesignerView();
singleItemSettings.DesignedDetailViewType =
typeof
(DetailsSimpleView).FullName;
views.Add(contentSelectorsSettings.ViewName, contentSelectorsSettings);
views.Add(listSettings.ViewName, listSettings);
views.Add(singleItemSettings.ViewName, singleItemSettings);
public
override
void
Initialize(ModuleSettings settings)
base
.Initialize(settings);
App.WorkWith()
.Module(NewsModule.ModuleName)
.Initialize()
.Configuration<NewsConfig>()
.Localization<NewsResources>()
.SitemapFilter<NewsNodeFilter>()
.TemplatableControl<MasterListView, NewsItem>()
.TemplatableControl<DetailsSimpleView, NewsItem>();
Boyan,
Hello,
Thank you for the additional clarification. In Sitefinity only ContentView based widgets support the TemplateEditor functionality. You can check the related implementation in our ProductsCatalog sample from our
Sitefinity SDK.
Regards,
Boyan Barnev
the Telerik team