More in this section

Forums / Developing with Sitefinity / How to get provider content in widget designer

How to get provider content in widget designer

2 posts, 0 answered
  1. Mauro
    Mauro avatar
    4 posts
    10 Mar 2014
    06 Apr 2015
    Link to this post

    I have created a custom widget that will be used in two different sites. I have also created a custom designer for this widget that allows users to customize the widget. One of the criteria is to give the user the option on selecting the content providers for this widget. Currently I can only pull one provider name which is the default provider, the other provider is the Open Access Provider for the site. I have set permissions for both sites in the Site Management page for each site. The code populates a Drop Down List with both providers to allow for selection in designer.

     Here is my code as follows in the designer.

     var multisiteContext = SystemManager.CurrentContext as MultisiteContext;
                var sites = multisiteContext.CurrentSite.Name;
                var providers = multisiteContext.CurrentSite.GetProviders("ModuleName").Select(p => p.ProviderName);
                DropDownList SiteList = (DropDownList)this.dataSourceName;
                foreach(var p in providers)

            IEnumerable<EventProvider> GetProviders(string dataSourceName)
                var sn = SystemManager.CurrentContext.CurrentSite.SiteDataSourceLinks;
                return SystemManager.CurrentContext.CurrentSite.SiteDataSourceLinks
                    .Where(o => o.DataSourceName == dataSourceName)
                    .Select(o => new EventProvider
                            ProviderName = o.ProviderName,
                            SiteName = ((MultisiteContext)SystemManager.CurrentContext).GetSiteById(o.SiteId).Name

  2. Kaloyan
    Kaloyan avatar
    272 posts
    06 Feb 2017
    09 Apr 2015
    Link to this post
    Hello Mauro,

    you can check the following forum thread that might be helpful:

    Multisite - Accessing content across sites.

    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered