Groups > Application developers > Community Server Feed Reader and roller > Re: Manual cutoff for feed




Manual cutoff for feed

Manual cutoff for feed
Wed, 2 Aug 2006 14:53:51 +0000
In the control panel you can specify a set length for a post to be cutoff when
it is being aggregated.  Is there a way to specify a manual (optional) per post
cut-off?

 

For example, I aggregate one forum section on my site to a front page news type
feed.  Sometimes I only want a few lines to display on the front page rather
than the first 500 (the value I have set in Control Panel) characters for
asthetic formatting reasons.  Is there a builtin way to specify this like a
[endfeed] tag or something?
Post Reply
Re: Manual cutoff for feed
Fri, 4 Aug 2006 16:13:20 +0000
You could use CommunityServer.Components.Formatter.Truncate(string text, int
maxLength) to truncate the forum post body to a custom length on the front page,
such as the following within a ThreadRepeater:

<%#
CommunityServer.Components.Formatter.Truncate(CommunityServer.Components.Formatt
er.StripAllTags(DataBinder.Eval(Container.DataItem, "FormattedBody"
).ToString() ) , 200) %>

Where 200 is the length you want to truncate the post body to. 

Forum posts do not support excerpts (blog posts do) which would have provided
more control on a per-post basis.
Post Reply
Re: Manual cutoff for feed
Fri, 4 Aug 2006 17:04:00 +0000
The Truncate method only exists in CS2.1 -- you can replace it with the
CheckStringLength method for 2.0
Post Reply
about | contact