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

Forums / Developing with Sitefinity / News Module Summary - 3.5 SP1

News Module Summary - 3.5 SP1

17 posts, 0 answered
  1. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    13 Feb 2009
    Link to this post
    Hi,
    has anyone had any success limiting the display of the news summary on the list to a maximum number of words as per the Events list.

    We are trying to get this done and would appreciate any help

    Cheers
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    13 Feb 2009
    Link to this post
    Hi Dale Palmer,

    You can have the same functionality for News Summary like this one you have for Events.
    Here is the solution.

    1. Open the control designer template  for news ~/Sitefinity/Admin/ControlTemplates/News/Design/NewsViewControlDesigner.ascx

    2. Find and remove the existing TextSetting for Summary

    <sfDesignSettings:TextSetting ID="TextSettingContent2" 
              TargetID="Summary" 
              SettingTitle="Summary" 
              AllowLabelSetting="false" 
              AllowFormatSetting="false" 
              AllowVisibilitySetting="True" 
              TargetVisibleByDefault="True"
    </sfDesignSettings:TextSetting> 

    3. Then put the following ContentSeting control in the same place.

    <sfDesignSettings:ContentSettingid="ContentSetting1" TargetID="Summary">  
    </sfDesignSettings:ContentSetting>   

    Here we have TargetID="Summary" which means that our settings will apply to the summary metafield of news items. If you change the ID to "content" your settings will apply to the News content.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    17 Feb 2009
    Link to this post
    Hi Ivan,

    tried this fix but I'm getting the following error:

     

    Server Error in '/' Application.

    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Literal content ('<sfDesignSettings:ContentSettingid="ContentSetting1" TargetID="Summary">   
                       </sfDesignSettings:ContentSetting>   

                       </sfDesignSettings:TextSetting>') is not allowed within a 'Telerik.Cms.Engine.WebControls.Design.ModeSettingsCollection'.

    Source Error:

    Line 89:                                               TargetVisibleByDefault="True">
    Line 90:                     </sfDesignSettings:TextSetting>
    Line 91: <sfDesignSettings:ContentSettingid="ContentSetting1" TargetID="Summary"> Line 92:                     </sfDesignSettings:ContentSetting>   
    Line 93: 

    Source File: /Sitefinity/Admin/ControlTemplates/News/Design/NewsViewControlDesigner.ascx    Line: 91


    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    17 Feb 2009
    Link to this post
    Hello Dale Palmer,

    As I see it, you have added the ContentSetting control on the wrong place. Please add the control under <mastersettigs> and remove existing TextSetting for Summary from there. You have added the control under <DetailSettings> node and this is the reason for the error you are getting.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    17 Feb 2009
    Link to this post
    Hi Ivan,

    done that and I'm still getting the same error - although in a different place:


    Parser Error

    Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

    Parser Error Message: Literal content ('<sfDesignSettings:ContentSettingid="ContentSetting1" TargetID="Summary">   
    </sfDesignSettings:ContentSetting>') is not allowed within a 'Telerik.Cms.Engine.WebControls.Design.ModeSettingsCollection'.

    Source Error:

    Line 182:                                              TargetVisibleByDefault="True">
    Line 183:                    </sfDesignSettings:TextSetting>
    Line 184: <sfDesignSettings:ContentSettingid="ContentSetting1" TargetID="Summary"> Line 185:</sfDesignSettings:ContentSetting>   
    Line 186:

    Source File: /Sitefinity/Admin/ControlTemplates/News/Design/NewsViewControlDesigner.ascx    Line: 184


    Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    17 Feb 2009
    Link to this post
    Hi Dale Palmer,

    Could you place a whitespace between the control name and its id as shown below:

    <sfDesignSettings:ContentSetting id="ContentSetting1" TargetID="Summary"
    </sfDesignSettings:ContentSetting> 

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    17 Feb 2009
    Link to this post
    Hi Ivan,

    that's got it sort of working.

    I now have the facility to select content or summary and choose how many words and whether to strip html (so far so good).  When I click [I'm Done], however, the changes are not applied and when I then click to edit the settings have not been saved

    Dale
  8. Dale Palmer
    Dale Palmer avatar
    20 posts
    Registered:
    12 May 2008
    17 Feb 2009
    Link to this post
    Hi Ivan,

    it's working now.  I had to delete the control from the page and re-add from scratch and all seems fine now.

    Thanks

    Dale
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    17 Feb 2009
    Link to this post
    Hi Dale Palmer,

    I am glad to hear that  everything is fine now. Let us know if there is anything else that we can do for you.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  10. shae
    shae avatar
    30 posts
    Registered:
    26 Jul 2012
    20 Sep 2010
    Link to this post
    Where does this code get added?
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    20 Sep 2010
    Link to this post
    Hello shae,

    Please take a look at the post from 2/13/2009- first reply made by Telerik Team. You can get all external templates from your account >> Download section. More information at How to map a template

    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
  12. shae
    shae avatar
    30 posts
    Registered:
    26 Jul 2012
    20 Sep 2010
    Link to this post
    Thanks for the help Ivan, I have the template mapped already, I'm just not sure where to place the code in the ascx file.
  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    20 Sep 2010
    Link to this post
    Hi shae,

    There are two steps

    1. Find and remove the existing TextSetting for Summary from the ControlDesigner template of NewsView control. Each presentation mode has its own TextSettings, so do the changes for the mode you want to change.

    2. Put the ContentSetting control in the same place where the default Summary TextSetting was.

    Sincerely yours,
    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
  14. shae
    shae avatar
    30 posts
    Registered:
    26 Jul 2012
    21 Sep 2010
    Link to this post
    Sort of working now. how do I get it to show the first 10 words of the content and not the summary.

     I just dont want to have to enter text into the summary field. It would be much easier to just show a summary of the content. Much like the Events control.
  15. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    09 Dec 2016
    21 Sep 2010
    Link to this post
    Hello shae,

    I suggest that you should go to the first post of this thread and read it again. You can also create a custom control that and use String.Substring method to returns sub string from the main string of the content field. The content you see is IContent.Content object

    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
  16. shae
    shae avatar
    30 posts
    Registered:
    26 Jul 2012
    29 Sep 2010
    Link to this post
    Removing the control from the page and re-adding the control got it working.

    thanks for  the help
  17. praveen
    praveen avatar
    11 posts
    Registered:
    02 Aug 2010
    10 Dec 2010
    Link to this post
    Hi,

    1. Open the control designer template  for news ~/Sitefinity/Admin/ControlTemplates/News/Design/NewsViewControlDesigner.ascx

    I am trying to modify as you said but I haven't got / Design folder and NewsViewContorlDesigner.ascx file under ~/Sitefinity/Admin/ControlTemplates/News.

    Please help me what I have to do for getting NewsViewControlDesigner.asck file.

    Thanks,

    Praveen Gundeti
Register for webinar
17 posts, 0 answered