RssAggregator
An RSS aggregator consumes an RSS feed and displays its information in a readable format. The RssAggregator server control lets you do the same by processing and displaying an RSS feed from any website. This lets you create an information Web page for news, stories, images, lists of music, and so on.
You can create a multi-level information Web page by placing several RssAggregator server controls on a page. For example, create a world news Web page by adding RSSRich Site Summary; regularly changing content, such as news sites and blogs link and send content to subscribers. feeds from the NY Times, BBC, and AFP (Agence France-Presse). To add an RSS Aggregator to your website:
- Drag and drop the RssAggregator server control a Web form.
- Set the
URL
property to point at the RSS feed. For example,http://msdn.example.com/rss.xml
When a site visitor views the Web form, the RSS feed displays properly. If the visitor refreshes the page, information updated by the RSS feed provider appears.
To change an RSS feed's appearance, create a custom XSLTExtensible Stylesheet Language Transformations.
Inserting the RssAggregator server control onto a page
Prerequisite
You must have installed the server controls. See Installing server controls into Visual Studio Toolbox.
- In Visual Studio, choose View > Toolbox.
- Click the Ektron server control tab to display the server controls.
- Drag the RssAggregator server control and drop it into the desired location on the page.
NOTE: You also can place the cursor on the page where you want the server control, then double click the server control that you want.
<CMS:RssAggregator ID="RssAggregator1" runat="server" />
- Click on
RssAggregator
in the code to display and modify the control’s properties using the Properties window of Visual Studio. The page is updated as you modify the property values.
RSS Aggregator properties
The following are Ektron-specific server controla server control uses API language to interact with the CMS and Framework UI to display the output. A server control can be dragged and dropped onto a Web form and then modified. properties. For information about native .NET properties such as font, height, width and border style, use Visual Studio® help.
- DisplayXslt (String)
Determines how the information on the page appears.
- None. Databind only.
- ecmNavigation. Lists the title of every RSS feed item.
- ecmTeaser. Lists a title and a description of every RSS feed item.
- Path to Custom Xslt. If desired, enter a relative or absolute path to an Xslt that determines the display of the page.
WARNING! Files stored in the
siteroot\Workarea
folder are overwritten (or deleted) when you upgrade Ektron. To avoid problems, copy the default file to a folder outside thesiteroot\workarea
folder then edit it. If there is no default file, create the file outside thesiteroot\workarea
folder. Next, in this property, enter the path to that file relative to the site root folder. - DoInitFill (Boolean)
By default, Fill occurs during the Page_Init event. Set to false if you want to postpone the fill-action until later. In this case, Fill is automatically called during the Page Render event. You might do this if you need to set or change a property on the control in code-behind and have it render with your changes shown.
- Hide (Boolean)
Hides or displays the output of the control in design time and run time.
- True. Hide the control output.
- False. Display the control output.
- Language (Integer)
Set a language for viewing the RssAggregator. This property shows results in design-time (in Visual Studio) and at run-time (in a browser).
- LinkTarget (ItemLinkTarget)
Determines the type of window that appears when you click a link in the server control.
- _Self (default). Opens in same window.
- _Top. Opens in parent window.
- _Blank. Opens in new window.
- _Parent. Opens in the parent frame.
- MaxResults (Integer)
The Maximum number of items from an RSS feed that are returned. 0 (zero) = unlimited.
- SuppressWrapperTags (Boolean)
Suppresses the output of the span/div tags around the control.
- True. Suppress wrap tags.
- False (default). Allow wrap tags.
- URL (String)
The RSS feed path for the server control. For example:
http://msdn.example.com/rss.xml
Retrieving the XML structure of an RssAggregator
Retrieving the XML structure of XML content allows for greater control over developing XSLs. To retrieve the XML structure:
- Open a new Web form.
- Drag and drop a RssAggregator server control onto it.
- Set the
URL
property. - Drag and drop a textbox on the Web form.
- Set the
TextMode
property to MultiLine.NOTE: You should set the text box width to at least 400px.
- Add the following line on the code-behind page.
Textbox1.Text. RssAggregator1.XmlDoc.InnerXml
- Build the project.
- View the Web form in a browser. The XML structure of the RssAggregator Menu appears in the textbox.