More in this section
Forums / Developing with Sitefinity / How to create a second ContentViewItemView.ascx

How to create a second ContentViewItemView.ascx

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. thomas3577
    thomas3577 avatar
    22 posts
    18 Feb 2007
    31 Oct 2009
    Link to this post
    I need a second view for Events and News. But i do not want override the exist ContentViewItemView.ascx
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    31 Oct 2009
    Link to this post
    Hi thomas3577,

    NewsView comes with only one presentation mode - List and Page. There are several presentation modes for EventsView control - listPageMode, ExpandableList, allInAListMode.

    To add new view you should do the following.

    1. Map the control designers for NewsView and EventsView controls.
    2.Create a new custom templates for your views.
    3. Add new Presentation mode in the Designer of the control.
    4. Create a TextSettings for the newly created modes.

    Sample code:

    <sfDesign:PresentationModes ID="presentationModes" runat="server">
                        <sfDesign:PresentationMode ID="CustomMode" runat="server"
                                                   MasterTemplateName="PATH TO YOUR TEMPLATE"
                                                   DetailTemplateName="PATH TO YOUR TEMPLATE"
                                                   CssClass="YOUR CSS"
                                                   SelectedCssClass="YOUR CSS
                                    <asp:RadioButton ID="CustomID" runat="server" />
                                    <p>some description about yoru presentation mode.</p>
     <sfDesign:PresentationModeSettings ID="CustomMode" runat="server">
                            <div class="selectedModeShortDescription">
                                 <h3>Selected mode</h3>
                                <h4 class="selectedTitlePageList">mode name</h4>
                                <p>some description</p>
                            <sfDesignSettings:PagingSetting id="pagingSetting" AllowListLimitSetting="true" DefaultListLimit="100" AllowPagingSetting="true" DefaultPageCount="10" LimitList="false" runat="server"></sfDesignSettings:PagingSetting>
                            <h4>For the list display</h4>
                            <sfDesignSettings:TextSetting ID="setting1"
                            <h4>For every item display:</h4>
                            <sfDesignSettings:TextSetting ID="TextSetting6"
                                                  SettingTitle="Title, linking to the post page"
                            <sfDesignSettings:BehaviorSetting id="behaviorSetting" runat="server"></sfDesignSettings:BehaviorSetting>

    All the best,
    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.
2 posts, 0 answered