1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Single NewsView Control driven by multiple providers

Single NewsView Control driven by multiple providers

5 posts, 0 answered
  1. LBrinley
    LBrinley avatar
    59 posts
    Registered:
    29 Dec 2005
    31 Mar 2009
    Link to this post
    Is there a way for me to aggregate content items from multiple providers into a single NewsView control?  I assume I could achive this by extending the NewsView control, but was hoping there might be an easier way.  If I must extend the NewsView, could you spoon-feed me a bit to nudge me at the correct overrides?

    Thanks.
  2. Parvan
    Parvan avatar
    151 posts
    Registered:
    24 Sep 2012
    02 Apr 2009
    Link to this post
    Hello Larry Brinley,

    Open your site web.config and set the value of the applicationName property of all your news providers to be equal, as shown in the highlighted code below:
    <cmsEngine defaultProvider="Generic_Content"
          <providers> 
            <clear/> 
            <add name="News"  
           applicationName="/News" .../> 
            <add name="NewsAlternativeProvider"  
           applicationName="/News" .../> 

    In this way, all news items will be shown in the NewsView control.

    Greetings,
    Parvan
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. LBrinley
    LBrinley avatar
    59 posts
    Registered:
    29 Dec 2005
    02 Apr 2009
    Link to this post
    Parvan,

    Thanks for the reply, but it does not produce a particularly satisfying solution.  I'm using different applicationName values for various news providers to differentiate them in the Admin, since each unique applicationName has a custom set of metafields and, therefor, custom insert/update interfaces.  The unique applicationNames also retrict the listing of News Item in each provider to those associated only with that applicationName -- the admin interface doesn't filter on provider name.

    Setting all the applicationNames to the same value (and then fixing all the entries in the database to allow the exiting items to appear on the site and in the admin) causes ALL news items regardless of provider to appear in each provider's list.  This, of course, will undoubtedly lead to confusion when my client tries to insert/update news items.

    What would I need to do to restrict the listing of news items by provider name, rather than applicationName?
  4. LBrinley
    LBrinley avatar
    59 posts
    Registered:
    29 Dec 2005
    03 Apr 2009
    Link to this post
    I resolved this 'issue' simply by using two newsview controls.  A heck of lot easier than rewriting the newsview class to allow for multiple providers.  It also allows me to keep my distinct applicationNames.  Why I didn't think of this first is beyond me.
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    06 Apr 2009
    Link to this post
    Hello,

    We are glad you have managed to find an answer, and apologize that haven't suggested it earlier.
    Don't hesitate to contact us if you have other questions.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Register for webinar
5 posts, 0 answered