Can you explain more?
Do you mean that you want to add a link to RSS feeds in your website in homepage?
Or do you want to show the content of a RSS feed in homepage?
Keyvan NayyeriWaegis Anti-Spam Filter - Stay Away from Spams on Your Community Server Sites
If you want to show some stuff from your CS site, it's possible to put some CS controls and show them but this is limited to some special controls not every control.
If you want to show content from other sites (especially from RSS feeds), you need to know .NET and put an XML control and show them there.
Actually I answered what I could understand from your posts.
You can control which feeds from which blogs are aggregated to the frontpage.
For instance, I have my own blog, and then I have an aggregated blog that a number of external feeds go to. I only allow one of these external feeds to show up on my frontpage using the following configuration option for the mirror:
Aggregate in site blog roll
No extra coding required.
Logik,
You're absolutely right about it but what these gentlemen want is another thing. They don't want to only show the content of a specific blog in homepage blog posts.
They want to show their favorite RSS feeds from any site as control in sidebar or any other thing to homepage.
Just to finish my answer I refer you to XSLT concept and XML control in ASP.NET. XML control simply can get the address of your RSS feed then use an XSL Transform to show its content in any desire view. So you need yo have a little (really little) background in XSLT.
This approach was what I did to show some syndications like Atom or Opml as you can see in 2.1. Without the XSL file I've written, they're just a simple text. You don't need to do a hard coding to reach to your aims. There are tons of sites which provided many XSL files for RSS/Atom feeds and you can get and modify them for your needs.
Hope this helps.
This maybe a long shot but I tried doing this and it worked for me.
You first copy the RSS address and go to a site that converts RSS feeds into Javascript. The resulting Javascript code can be pasted on the HTML editor in your homepage. You just have to fix the formatting if you want.
Ah... Thanks, Keyvan
You read that much better than I... Thanks for the follow-up.
If you want to display an RSS feed on the home page, here are the steps that I took.
1. Add attribute named "siteRssUrl" in "~/communityserver.config" (Line 79) <Core defaultLanguage="en-US" .... siteRssUrl=http://www.yoursite.com/rss.xml >
2. Modify "CSConfiguration.cs" file in "~/Configuration" of CommunityServerComponents project: - add private member variable (Line 61): private string siteRssUrl = String.Empty; - add new attribute from attributeCollection (Line 155): att = attributeCollection["siteRssUrl"]; if (att != null) siteRssUrl = att.Value; - add new public property (Line 434): public string SiteRssUrl { get { return siteRssUrl; } }
3. Modify "~/Languages/en-US/ControlPanelResources.xml" and add the following new resource nodes (Line 164): <resource name="CP_SiteRSS_Announcements">Current Site Features</resource> <resource name="CP_SiteRSS_Announcements_More"><a href=http://www.yoursite.com/"> Read more at ... &raquo;</a></resource> <resource name="CP_SiteRSS_NoAnnouncements">No feature stories are available.</resource>
4. Create new class libray file named "SiteRssFeed.cs" in "~/ControlPanel/Components" with the following code: using System; using CommunityServer.Reader.Components; using CommunityServer.Components; using CommunityServer.Configuration; using Rss; using System.Text.RegularExpressions; using System.Net; namespace CommunityServer.ControlPanel.Components { public class SiteRssFeed { static Regex stripHtml = new Regex("<[^>]*?>", RegexOptions.IgnoreCase | RegexOptions.Singleline); private SiteRssFeed() { } public static RssItemCollection GetAnnouncements() { RssItemCollection items; items = (RssItemCollection)CSCache.Get("CP-SiteRss"); if (items != null) return items; items = new RssItemCollection(); if (Globals.IsNullorEmpty(CSConfiguration.GetConfig().SiteRssUrl)) return items; Feed feed = new Feed(); feed.Url = CSConfiguration.GetConfig().SiteRssUrl; feed.Title = "Current Site Features"; RssFeed rssFeed = null; try { HttpWebRequest request = feed.CreateRequest(); request.Timeout = 10000; // timeout in ten seconds rssFeed = RssFeed.Read(request); } catch (Exception) { return items; } if (rssFeed != null && rssFeed.Channels != null && rssFeed.Channels.Count >= 1) { RssItem newItem; foreach (RssItem item in rssFeed.Channels[0].Items) { newItem = new RssItem(); newItem.Link = item.Link; newItem.Title = stripHtml.Replace(item.Title, ""); newItem.Description = stripHtml.Replace(item.Description, ""); if (newItem.Description.Length > 250) newItem.Description = newItem.Description.Substring(0, 250) + "..."; items.Add(newItem); if (items.Count == 5) break; } } CSCache.Insert("CP-SiteRss", items, new System.Web.Caching.CacheDependency(null, new string[] { CommunityServer.Configuration.CSConfiguration.CacheKey }), 60 * 60 * 24); return items; } } }
5. Modify "~/Default.aspx" file as follows: - Register the control <%@ Register TagPrefix="CP" Namespace="CommunityServer.ControlPanel.Controls" Assembly="CommunityServer.Web" %> - Add following two lines of code to Page_Load function (Line 16): this.Announcements.DataSource = CommunityServer.ControlPanel.Components.SiteRssFeed.GetAnnouncements(); this.Announcements.DataBind(); - Add the following block of HTML below Featured Item content (Line 57): <div class="CommonSidebarArea"> <h4 class="CommonSidebarHeader"><CP:ResourceControl runat="server" ResourceName="CP_SiteRSS_Announcements" ID="Resourcecontrol15"/></h4> <div class="CommonSidebarContent"> <CS:RepeaterPlusNone runat="server" id="Announcements"> <ItemTemplate> <div style="margin-bottom: 8px; margin-top: 8px;"> <a href="<%# DataBinder.Eval(Container.DataItem, "Link")%>"><%#DataBinder.Eval(Container.DataItem, "Title")%></a> <div><%#DataBinder.Eval(Container.DataItem, "Description")%></div> </div> </ItemTemplate> <NoneTemplate> <div style="margin-bottom: 8px; margin-top: 8px;"> <CP:ResourceControl runat="server" ResourceName="CP_SiteRSS_NoAnnouncements" /> </div> </NoneTemplate> </CS:RepeaterPlusNone> <CP:ResourceControl runat="server" ResourceName="CP_SiteRSS_Announcements_More" ID="Resourcecontrol16"/> </div> </div>
Hello,
Have you succeded in this task? I am not a programmer but I would really like to have this possibility.
Is there any other (no coding required) way to have RSS feeds displayed on the home page?
Thanks in advance for the help.
Marian VULPE
The easiest way would probably be as mentioned before to use a rss to java converter (possibly not as search engine friendly?). I just did it and it will probably take longer to write this than it took to implement the rss into my site...open up themes/default/common/home.aspx and paste the code below in there somewhere this will give you an editable content part just make sure you change the parts in bold, i put mine below the welcome content part. <CSControl:ContentPart ID="ContentPart1" ContentName="yourcontentpartname" runat="server" ContentCssClass="CommonContentPartBorderOff" ContentHoverCssClass="CommonContentPartBorderOn"> <DefaultContentTemplate> <h2 class="CommonTitle">Your Title</h2> <div class="CommonContent"> <div style="line-height: 140%;"> </div> </div> </DefaultContentTemplate> </CSControl:ContentPart>Then go to an rss to java converter site. I used http://www.rss-to-javascript.com it was the first one i found but it does let you fine tune the way your feed will look. In any case just copy the code it generates and paste it between <div style="line-height and </div>
Edit note: I have been using this method for a bit now and have noticed that at times the feed does not render and requires a page refresh...its kind of annoying
peace shakes
Carolina Pulse
Copyright© 2008 Telligent Systems Inc. All rights reserved CommunityServer.com • Telligent.com