Views: | 23905 |
Number of votes: | 3 |
Average rating: |
Dynamic content is one of the new useful features of the upcoming version of EPiServer CMS – R2. The idea behind dynamic content is to allow developers to create a ‘tool box’ of reusable features that editors can use any where they want and thereby making the page templates more flexible and powerful.
As described in the article Dynamic Content - Greater Freedom and Efficeincy for Editors, the CTP version of EPiServer CMS R2 ships with a dynamic content control called ‘Page Property’. This useful control makes it possible to fetch properties from another page. Information such as contact information, that might be repeated on many different parts of the web site can bestored in one location, and re-used throughout the entire web site.
EPiServer CMS developers can easily create more advanced dynamic content controls that editors can use on different parts of the web site.
As an example of how dynamic content can be used, we have developed a dynamic content control called ‘RSS Feed’, which can be used to show the content of external RSS sources such as news papers or blogs. This control makes it possible for editors to insert news feeds on any part of the web site, making the web site update automatically as new items are published in the external RSS feeds.
Once deployed and configured, the dynamic content control is very easy to use. In the following example, we want a blog feed from ‘EPiServer World’ to appear in the secondary body of a standard page (EPiServer CMS sample templates).
First, the editors choose where the news feed should appear and click the ‘Insert dynamic content’ in the editor.
The ‘Dynamic Content’ pop up appears and allows us to select which dynamic content control that should be inserted. We also set the following properties on our RSS reader control:
The last property is used for performance reasons. The list will be cached for a specified number of seconds because we don’t want to fetch the RSS feed every time the page is requested.
After the dynamic content block has been inserted, it appears as a yellow box in the editor.
After the page is saved, the news list appears on the web site. The page will now be regularly updated with content from the external news feed.
This is just one example of how dynamic content can be used. The possibilities of creating dynamic controls are pretty much endless. Here are a few more ideas of how dynamic content could be used:
The source code to the RSS Feed dynamic content control can be downloaded here. Please follow these steps to include the RSS feed control in your solution.
Example:
<dynamicContent>
<controls>
<add description="Displays a list of items from an external RSS source" name="RSS Feed" type="DynamicContentExample.RSSFeed, EPiServer.Templates.Public"/>
</controls>
</dynamicContent>
For more technical information on development and deployment of dynamic content controls, please see the following article:
http://world.episerver.com/en/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-5-R2-CTP/EPiServer-Dynamic-Content/
Hi
I converted my solution to vs2010 using 4.0 framework and this control giving error at runtime on this line i.e.
var rssControl = (RSSFeedControl)hostPage.LoadControl("~/RSSFeedControl.ascx");
Error is like Unable to Cast ASP.dynamiccontent_................
Earlier it was working fine in 3.5 framework.
any idea why this happening?