Feeds Settings

Feeds Settings

Feeds Settings

  • ClientFeeds.ItemExpiration  - Items older than the specified number of days will not be included in the client feed. Default value: 0, expiration is disabled.
  • ClientFeeds.MaximumItemsInFeed is the maximum number of items to include in the client feed. Default value: 50
  • Feeds.ItemExpiration - Items older than the specified number of days will not be included in the feed.  Default value: 0, expiration is disabled
  • Feeds.MaximumItemsInFeed is the maximum number of items to include in the feed.  Default value: 50

Controls featured in this example:

  • Sitecore Web Control

Classes featured in this example:

  • Sitecore.Configuration.Settings.ClientFeeds
  • Sitecore.Data.Items.Item

Configuration Settings

<customHandlers>
<handler trigger="~/feed/" handler="sitecore_feed.ashx" />
</customHandlers>

<getContentEditorWarnings>
<processor type="Sitecore.Pipelines.GetContentEditorWarnings.FeedIsEmpty, Sitecore.Kernel" />
</getContentEditorWarnings>
<xslControls>
<control mode="on" tag="sc:feedItem" type="Sitecore.Web.UI.XslControls.FeedItem" assembly="Sitecore.Kernel" />
</xslControls>
<configuration>
<settings>
<setting name="ClientFeeds.ItemExpiration" value="0" />
<setting name="ClientFeeds.MaximumItemsInFeed" value="50" />
<setting name="Feeds.ItemExpiration" value="0" />
<setting name="Feeds.MaximumItemsInFeed" value="50" />
</settings>
<handlers>
<add verb="*" path="sitecore_feed.ashx" type="Sitecore.Shell.Feeds.FeedRequestHandler, Sitecore.Kernel" name="Sitecore.FeedRequestHandler" />
</handlers>

 
<httpHandlers>
<add verb="*" path="sitecore_feed.ashx" type="Sitecore.Shell.Feeds.FeedRequestHandler, Sitecore.Kernel" />
</httpHandlers>

C# Web Control Code

Sitecore.Data.Items.Item item = Sitecore.Context.Item;
if (item == null) return;

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.Write("C# Web Control Real-time Output");
output.RenderEndTag();

output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-size:x-small; width:100%; clear:both");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.Div);
output.AddAttribute(System.Web.UI.HtmlTextWriterAttribute.Style, "font-weight:bold");
output.RenderBeginTag(System.Web.UI.HtmlTextWriterTag.P);
//using &#58; for colon and &#160; for space
output.Write("{0}&#58;&#160;{1}", "Item", item.DisplayName);
output.RenderEndTag(); //P

string itemExpiration = Sitecore.Configuration.Settings.ClientFeeds.ItemExpiration.ToString();
string maxItemsInFeed = Sitecore.Configuration.Settings.ClientFeeds.MaximumItemsInFeed.ToString(); 
string feedsItemExpiration = Sitecore.Configuration.Settings.Feeds.ItemExpiration.ToString();
string feedsMaxItemsInFeed = Sitecore.Configuration.Settings.Feeds.MaximumItemsInFeed.ToString();

output.Write("{0}&#58;&#160;{1}", "Client Feeds Item Expiration", "<b>" + itemExpiration + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Client Maximum Items in Feed", "<b>" + maxItemsInFeed + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Feeds Item Expiration", "<b>" + feedsItemExpiration + "</b><br/>");
output.Write("{0}&#58;&#160;{1}", "Feeds Max Items In Feed", "<b>" + feedsMaxItemsInFeed + "</b>");
           
output.RenderEndTag(); //Div


C# Web Control Real-time Output

Item: Feeds Settings
Client Feeds Item Expiration: 
Client Maximum Items in Feed: 50
Feeds Item Expiration: 
Feeds Max Items In Feed: 50