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

Forums / Developing with Sitefinity / News Module Summary

News Module Summary

14 posts, 0 answered
  1. Simon
    Simon avatar
    31 posts
    Registered:
    01 May 2009
    12 May 2009
    Link to this post
    In Sitefinity 3.6 what is the best way to go about limiting the number of characters that can be entered in the summary field of a news item?

    Thanks
    Simon
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    12 May 2009
    Link to this post
    Hello Simon,

    Generally NewsViewControl designer does not support setting of summary length. Here is the solution:

    1. Map NewsViewControlDesigner.ascx template. The external one can be download from MyClient.net - there is a zip archive with all external templates and sample configuration file.

    2. After yo have  successfuly added the template remove the existing settings for news summary

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

    3. Add the following lines instead

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


    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.
  3. Simon
    Simon avatar
    31 posts
    Registered:
    01 May 2009
    12 May 2009
    Link to this post
    I don't quite understand how this should work. I've mapped the new template and added the config file, this is all fine, but where do I indicate exactly how many characters I want to limit the summary text box to?
    Thanks
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    12 May 2009
    Link to this post
    Hi Simon,

    This is a control which will allow you to set the summary length. It is the same one that is used for EventsView. You need to map the control designer for NewsView control - NewsViewControlDesigner. Then follow the steps from the last post.

    Greetings,
    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. Simon
    Simon avatar
    31 posts
    Registered:
    01 May 2009
    13 May 2009
    Link to this post
    Sorry, I don't follow. I've mapped NewsViewControlDesigner.ascx - I've added this to the configuration file:
    <?xml version="1.0" encoding="utf-8"?>  
    <controlsConfig> 
      <viewMap> 
          <!--Provides user interface for NewsViewDesigner control which allows modifications of NewsView designer.--> 
          <viewSettings hostType="Telerik.News.WebControls.Design.NewsViewDesigner" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/News/NewsViewControlDesigner.ascx" /> 
          <!--Provides user interface for displaying the archive of the news items in the News module.--> 
          <viewSettings hostType="Telerik.News.WebControls.NewsArchive" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ArchiveTemplate.ascx" /> 
          <viewSettings hostType="Telerik.News.WebControls.NewsView">  
              <additionalTemplates> 
                  <!--Provides user interface for displaying a list of news items in the NewsView control for the News module.--> 
                  <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ListPageMaster.ascx" /> 
                  <!--Provides user interface for displaying a single news item in the NewsView control of the News module.--> 
                  <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx" /> 
              </additionalTemplates> 
          </viewSettings> 
      </viewMap> 
    </controlsConfig> 
    And added the file here: /Sitefinity/Admin/ControlTemplates/News/NewsViewControlDesigner.ascx.

    What else, exactly. do I have to do in order to set a character limit on the summary control?

  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    13 May 2009
    Link to this post
    Hi Simon,

    Open the template in an editor(VS or another you use ). Then follow step 2 and step3. I am posting the same things twice which does not make sense if you do not follow them.

    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.
  7. Simon
    Simon avatar
    31 posts
    Registered:
    01 May 2009
    14 May 2009
    Link to this post
    Hi Ivan,
    Sorry I should have made it clear in my previous post. I have followed all the steps you set out.
    I have mapped NewsViewControlDesigner.ascx in the configuration file as shown I have added the file to the solution in the correct folder and I have edited the template as indicated.

    <%@ Control Language="C#" %> 
    <%@ Register Namespace="Telerik.Cms.Engine.WebControls.Design.Selectors" Assembly="Telerik.Cms.Engine" TagPrefix="sfDesignSelectors" %> 
    <%@ Register Namespace="Telerik.Cms.Engine.WebControls.Design" Assembly="Telerik.Cms.Engine" TagPrefix="sfDesign" %> 
    <%@ Register Namespace="Telerik.Cms.Engine.WebControls.Design.Settings" Assembly="Telerik.Cms.Engine" TagPrefix="sfDesignSettings" %> 
     
    <div class="ctrlProps">  
        <div class="ctrlContent slidingWizard">  
            <div id="slidingWizardSteps">  
              
                <!-- Wizard panel 1 --> 
                <div id="Panel1">  
                    <h3><asp:Literal runat="server" Text="<%$Resources:WhichNewsToDisplay %>"></asp:Literal></h3>  
                    <div> 
                        <sfDesignSelectors:CategorySelector ID="ParentSelector" runat="server" SelectAllItemsText="Display all news" SelectSpecificItemsText="Display only news in specific categories" TypeName="Telerik.Cms.Engine.ContentManager" SelectedMethod="GetCategories" DataKey="CategoryName" /> 
                    </div> 
                      
                    <div class="extLinks"></div> 
                </div> 
                <!-- end wizard panel 1 --> 
                  
                <!-- wizard panel 2 --> 
                <div id="Panel2">  
                    <h3><asp:Literal runat="server" Text="<%$Resources:HowToOrganizeNews %>"></asp:Literal></h3>  
                      
                    <div id="itemsDisplayOptions" class="contentViewDisplayOptions">  
                    <ul> 
                    <sfDesign:PresentationModes ID="presentationModes" runat="server">  
                            <sfDesign:PresentationMode ID="listPageMode" runat="server" 
                                                        ModeTitle="List &amp; page" 
                                                        ModeSettingsId="ModeSettings1" 
                                                        MasterTemplateName = "Telerik.News.Resources.ControlTemplates.Frontend.Modes.ListPageMaster.ascx" 
                                                        DetailTemplateName = "Telerik.News.Resources.ControlTemplates.Frontend.Modes.ListPageDetails.ascx" 
                                                        CssClass="pageListMode" 
                                                        SelectedCssClass="selectedOption pageListMode" 
                                                        > 
                                <Template> 
                                    <asp:RadioButton ID="listPageRadio" runat="server" /> 
                                    <p>A list of news titles and summaries (optional). The full news article opens in a separate page.</p> 
                                </Template> 
                            </sfDesign:PresentationMode> 
                    </sfDesign:PresentationModes> 
                    </ul> 
                      
                    </div> 
                  
                </div> 
                <!-- end wizard panel 2 --> 
                  
                <!-- wizard sliding navigation --> 
                <ol class="slidingWizardNavigation">  
                    <li class="previous"><href="#" onclick="setMovement('next'); "><strong>Settings</strong> 
                        (optional)</a></li>  
                    <li class="next"><href="#" onclick="setMovement('prev'); ">Back</a></li>  
                </ol> 
                <!-- end wizard sliding navigation --> 
                  
                <!-- wizard panel 3: optional settings for selected mode --> 
                <div id="Panel3">  
                <h3>News settings</h3> 
                <div id="optionalSelectedMode">  
                <sfDesign:PresentationModeSettings ID="ModeSettings1" runat="server">  
                    <DetailHeaderTemplate> 
                        <div class="selectedModeShortDescription">  
                                 <h3>Selected mode</h3> 
                                <h4 class="selectedTitlePageList">List &amp; page</h4> 
                                <p>A list of news titles and summaries (optional). The full news article opens in a separate page.</p> 
                            </div> 
                        <sfDesignSettings:PagingSetting id="pagingSetting" AllowListLimitSetting="true" DefaultListLimit="100" AllowPagingSetting="true" DefaultPageCount="10" LimitList="false" runat="server"></sfDesignSettings:PagingSetting> 
                        <h4>In the news page, display:</h4> 
                        <ul> 
                    </DetailHeaderTemplate> 
                    <DetailSettings> 
                        <sfDesignSettings:TextSetting ID="setting1" 
                                                  TargetID="fullContent1" 
                                                  SettingTitle="Title, linking to the full article"   
                                                  AllowLabelSetting="False"   
                                                  AllowFormatSetting="False" 
                                                  AllowVisibilitySetting="False" 
                                                  TargetVisibleByDefault="True">  
                        </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="setting2" 
                                                  TargetID="Publication_Date"   
                                                  SettingTitle="Date"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="True" 
                                                  FormatType="DateTime" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                        </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="TextSettingContent" 
                                                  TargetID="Summary" 
                                                  SettingTitle="Summary" 
                                                  AllowLabelSetting="false" 
                                                  AllowFormatSetting="false" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True" 
                                                  > 
                        </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="TextSetting9" 
                                                  TargetID="content" 
                                                  SettingTitle="Content" 
                                                  AllowLabelSetting="false" 
                                                  AllowFormatSetting="false" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True" 
                                                  > 
                        </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="TextSetting2" 
                                                  TargetID="Author"   
                                                  SettingTitle="Author"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="True" 
                                                  FormatType="String" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                        </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="TextSetting13" 
                                                  TargetID="Source"   
                                                  SettingTitle="Source"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="True" 
                                                  FormatType="String" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                        </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="TextSetting4" 
                                                  TargetID="Tags"   
                                                  SettingTitle="Tags"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="False" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                        </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="TextSetting5" 
                                                  TargetID="Category"   
                                                  SettingTitle="Category"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="False" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                        </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="TextSetting7" 
                                                  TargetID="Bookmarks"   
                                                  SettingTitle="Social bookmarks (del.icio.us, digg, reddit)"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="False" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                        </sfDesignSettings:TextSetting>   
                    </DetailSettings> 
                    <DetailFooterTemplate> 
                        </ul> 
                    </DetailFooterTemplate> 
                    <MasterHeaderTemplate> 
                        <h4>For every item in the news list, display:</h4> 
                        <ul> 
                    </MasterHeaderTemplate> 
                    <MasterSettings> 
                        <sfDesignSettings:TextSetting ID="TextSetting1" 
                                                  TargetID="fullContent1" 
                                                  SettingTitle="Title, linking to the full article"   
                                                  AllowLabelSetting="False"   
                                                  AllowFormatSetting="False" 
                                                  AllowVisibilitySetting="False" 
                                                  TargetVisibleByDefault="True">  
                        </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="TextSetting6" 
                                                  TargetID="Publication_Date" 
                                                  SettingTitle="Date"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="True" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                        </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="TextSetting8" 
                                                  TargetID="Author"   
                                                  SettingTitle="Author"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="False" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                                                  </sfDesignSettings:TextSetting> 
                        <sfDesignSettings:TextSetting ID="TextSetting14" 
                                                  TargetID="Source"   
                                                  SettingTitle="Source"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="True" 
                                                  FormatType="String" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                        </sfDesignSettings:TextSetting> 
                          <sfDesignSettings:ContentSetting id="ContentSetting1" TargetID="Summary" runat="server">     
                            
                            </sfDesignSettings:ContentSetting>   
     
                          <sfDesignSettings:TextSetting ID="TextSetting3" 
                                                  TargetID="fullContent2"   
                                                  SettingTitle="Permanent link"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="False" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                          </sfDesignSettings:TextSetting> 
                          <sfDesignSettings:TextSetting ID="TextSetting12" 
                                                  TargetID="ThumbnailHolder" 
                                                  SettingTitle="Thumbnail" 
                                                  AllowLabelSetting="false" 
                                                  AllowFormatSetting="false" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                                                  </sfDesignSettings:TextSetting> 
                          <sfDesignSettings:TextSetting ID="TextSetting10" 
                                                  TargetID="Tags"   
                                                  SettingTitle="Tags"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="False" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                                                  </sfDesignSettings:TextSetting> 
                          <sfDesignSettings:TextSetting ID="TextSetting11" 
                                                  TargetID="Category"   
                                                  SettingTitle="Category"   
                                                  AllowLabelSetting="True"   
                                                  AllowFormatSetting="False" 
                                                  AllowVisibilitySetting="True" 
                                                  TargetVisibleByDefault="True">  
                                                  </sfDesignSettings:TextSetting> 
                    </MasterSettings> 
                    <MasterFooterTemplate> 
                        </ul> 
                        <sfDesignSettings:BehaviorSetting id="behaviorSetting" runat="server"></sfDesignSettings:BehaviorSetting> 
                    </MasterFooterTemplate> 
                    </sfDesign:PresentationModeSettings> 
                </div> 
                </div> 
            </div> 
        </div> 
    </div> 
     
    <asp:HiddenField ID="designerIsDirty" runat="server" /> 
    <asp:HiddenField ID="selectedModeIdField" runat="server" /> 
    <asp:HiddenField ID="selectedModeClientIdField" runat="server" /> 
     
    <script type="text/javascript">  
     
    var eventsOptionsItems = document.getElementById("itemsDisplayOptions").getElementsByTagName("LI");  
     
    if( eventsOptionsItems ) {  
     
     
        for( var i = 0; i < eventsOptionsItems.length; i++) {  
     
            eventsOptionsItems[i].onclick = function () {  
                this.getElementsByTagName("input")[0].click();  
            }  
     
        }  
     
     
    }  
     
     
    </script> 

    These are all the steps mentioned in your post. What else is required?
    Thanks.
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    14 May 2009
    Link to this post
    Hi Simon,

    As I see it, you have set the summary " For every item in the list..." Now, when you open NewsView control in edit mode you will see that you have a new property under "Settings" section called "summary". Check out attached screenshot.
    You can also limit the number of characters that can be inserted when content item is created/edited using TextBox.MaxLength Property in the NewsItemNew and NewsItemEdit templates for the summary textbox.

    Greetings,
    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.
  9. Simon
    Simon avatar
    31 posts
    Registered:
    01 May 2009
    14 May 2009
    Link to this post
    Brilliant, thanks for you help.
    Simon.
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    14 May 2009
    Link to this post
    Hello Simon,

    Always glad to help to the community!

    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.
  11. Dennis
    Dennis avatar
    19 posts
    Registered:
    26 May 2009
    08 Oct 2009
    Link to this post
    Hi,

    When viewing a news in detailed view I would like to style the summary part with "bold" - but you have not applied a css class to the summary paragraph.

    All the other parts have css classes like sf_title, sf_date and so on.

    Is there a workaround until you fix that?

    Regards,

    Dennis
  12. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    08 Oct 2009
    Link to this post
    Hello Dennis,

    You can use the external template for Details view, located at  ~/Sitefinity/ControlTemplates/News/ListPageDetails.ascx and assign this <p> tag  a class:
    <p class="myClass">
        <asp:Literal ID="Summary" runat="server"></asp:Literal>
    </p>

    Then provide rules for the class in your theme. All you have to do next is to tell the news view to use this external template for the details view.

    If you need more information on external templates, take a look at the following KB article.

    Greetings,
    Radoslav Georgiev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  13. Dennis
    Dennis avatar
    19 posts
    Registered:
    26 May 2009
    08 Oct 2009
    Link to this post
    Hello again

    Thank you for your quick response but maybe I'm missing something.

    The file ListPageDetails.ascx is not part of the specified folder. The file is not anywhere to be fount in my filesystem.

    Do I need to install some additional files or something? (I'm running SF 3.7)

    Regards,

    Dennis
  14. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    08 Oct 2009
    Link to this post
    Hi Dennis,

    Please take a look at the KB article suggested by Rado. You need to download the external templates and map them. Please check out the following post. NewsView is a ContentView based control, so that you should map the template using the approach in the provided blog post.

    Let us know if there is anything else that we can do for you.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
14 posts, 0 answered