Connect the RSS web part with a SharePoint list or other advanced feed

January 14, 2009   19:26


I wrote this blog to give a possible workaround for RSS Web Part problems with certain feeds.

Did you ever try to connect a list feed to a SharePoint RSS feed web part? Well, I did, and it doesn’t work. The web part returned me a redirect error on public Internet sites and an authentication problem on secure Intranet sites.

Connect the RSS web part with a SharePoint list or other advanced feed

The RSS web part is not able to handle secure RSS connections. After some debugging the problem of the redirect error was found in the fact, that certain RSS feeds are trying to return a cookie, which a web part normally does not accept. Because the cookie is not set, the RSS generator keeps redirecting the download request.

The cookie and authentication problems do not only apply to the SharePoint list feed, but also to a lot of other feeds on the internet.

The work around

To get correct RSS feeds in the standard SharePoint RSS feed web part, I’ve chosen to develop a small “proxy” handler to access the feed in Visual Studio.
(more…)

Tags: , , , , , , , , .





Change the Subsites and Pages navigation setting by code

February 27, 2008   11:12


It took me quite some time to figure out how to change the Subsites and Pages settings by code. I finally manged to change them. The setting “Show subsites” can be altered in 2 ways. I was only able to change the “Show pages” on a publishing site.

Change the Subsites and Pages navigation setting by code

Method 1 (”Show subsites” only)
With this code you will access the AllProperties setting of the Sharepoint Site and change the __IncludeSubSitesInNavigation value. Somehow there is no such property for the “Show pages”.

SPWeb web = new SPSite(webCollection).OpenWeb();
web.AllProperties["__IncludeSubSitesInNavigation"] = “False”;
web.Update();
web.Close();
web.Dispose();

Method 2
With this code the “Show pages” and “Show subsites” option are disabled. To access these properties your site must be a publishing site.

SPWeb web = new SPSite(webCollection).OpenWeb();
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
publishingWeb.IncludePagesInNavigation = false;
publishingWeb.IncludeSubSitesInNavigation = false;
publishingWeb.Update();
publishingWeb.Close();
web.Close();
web.Dispose();
Tags: , , , , , , , .









The content expressed in this blog are those of Edwin Vriethoff and do not represent his employer's view in anyway. The contents of this blog has been carefully put together, but Edwin Vriethoff is not responsible in any way for any direct or indirect harm caused by individuals or organizations using the content of this blog in any way.