More in this section
Forums / Developing with Sitefinity / Get content from outside sitefinity

Get content from outside sitefinity

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. Ricardo
    Ricardo avatar
    29 posts
    06 Nov 2012
    02 Jul 2013
    Link to this post

    I am having some issues and turning to the community for help.

    I am able to get some content through a different app, although I get a bit of a odd behaviour.
    I can actually get the shared content items no problem, but as what I am trying to do is getting all types of content, for some reason this does not work.

    For example, this works without a problem and gets me the shared control items (although I want the non shared ones as well).
     var controls = App
                            .Where(c => c.Status == Telerik.Sitefinity.GenericContent.Model.ContentLifecycleStatus.Live)

    The odd part is that the following does not work as I am also unable to connect to anything related to pages.
    var pageNodes = App
                            .Where(pN => (pN.Page != null && pN.Page.Status == ContentLifecycleStatus.Live))

    So I have tried different things within a widget and that worked fine: e.g.
     public static List<ControlData> GetContentItems(string pageTitle, string placeHolder)
                var pageManager = PageManager.GetManager();
                var page = pageManager.GetPageNodes().Where(p => p.Title == pageTitle).SingleOrDefault();
                var controls = page.Page.Controls.Where(c => c.PlaceHolder == placeHolder).ToList<ControlData>();
                return controls;
    The code above returns all the controls if used within a widget, but that code simply does not work within the external app. All the references seem to be correct. Is there  a limitation on the architecture of sitefinity to get this externally?

    As anyone seen this type of behaviour? Any examples/help would be much appreciated as I am really stuck.

    Many thanks for your help as I am really stuck!


  2. Stanislav Velikov
    Stanislav Velikov avatar
    1113 posts
    18 Sep 2017
    04 Jul 2013
    Link to this post
    Hello Ricardo,

    Sitefinity API can`t be executed from external application that is not sitefinity the API needs the configuration files from App_Data/Sitefinity/Configuration folder, sitefinity services in Sitefinity/Services folder, web.config, basically all sitefinity related files that execute the web services and communication with the database where the data is stored. I am not sure if you have sitefinity assemblies placed for example in console application or another C# project from where the API is executed.

    The concrete approach is to create a web service that utilizes sitefinity API and executes it in sitefinity then sends the result to another application.

    Stanislav Velikov
    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 Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered