+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / News Summary

News Summary

6 posts, 0 answered
  1. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    12 Feb 2010
    Link to this post
    Hi,
    I am using sitefinity news module for news section in my website.
    i also have news control for latest 1 news on my home page. I have created copy of ListPageMaster.ascx for that to apply different look and feel to that control, Which is working fine.
    problem is in that news control I want to display only starting 20 characters of news summary along with news title. What changes has to be done in ListPageMaster.ascx so that I will get those changes...

    -- Thanx
    Shraddha
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 Feb 2010
    Link to this post
    Hi shraddha,

    The built in NewsView controls supports summary. You can also set your custom summary using SummarySettings class.

    SummarySettings settings = new SummarySettings();
    settings.Count = 10;
    settings.Mode = SummarySettings.SummaryMode.Words;

    If you have a custom control that inherits from NewsView you can override SetItemMetaData and set the limit to the title and summary length.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    12 Feb 2010
    Link to this post
    Hi,
    Thanx for the reply...
    settings.Count = 10;
    settings.Mode = SummarySettings.SummaryMode.Words;
    are giving error as "Porperty or indexer cannot be assigned to... it is read only..."



    --Shraddha
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 Feb 2010
    Link to this post
    Hi shraddha,

    Try using this code

    SummarySettings defaultSetting = new SummarySettings(Telerik.Cms.Engine.SummarySettings.SummaryMode.Words, 10, false, new string[] { "tagsToClear" });


    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  5. shraddha
    shraddha avatar
    87 posts
    Registered:
    18 May 2009
    15 Feb 2010
    Link to this post
    Hi,
    I have used the given code. Now it is not giving any error. But it is not giving the required result also.
    In that code, we are just settings word length for custom summary. How can we bind that custom summary to news list control summary?

    --Shraddha
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    15 Feb 2010
    Link to this post
    Hello shraddha,

    The ContentView based controls like NewsView has a property SummarySettings which you can use

    newsViewControl.SummarySettings = defaultSetting;

    Another option is getting the content item as string text = contentItem.Content as string and then use String.Substring Method

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Register for webinar
6 posts, 0 answered