More in this section

Forums / Developing with Sitefinity / How can I add info like start date to events list?

How can I add info like start date to events list?

11 posts, 0 answered
  1. Stanimira
    Stanimira avatar
    12 posts
    Registered:
    30 Jan 2009
    30 Jan 2009
    Link to this post
    How can I add info(column) like start date to events list?
    Are there settings where I can choose what other information apart from event name I would like to see for each event in the events list?
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 Jan 2009
    Link to this post
    Hello Stanimira,

    The EventsView control works in two behavior modes:

    • Master mode - the control displays only a list of content items. This mode does not provide the ability to view the specific item in the page
    • Detail mode - when this mode is selected, the control displays only one content item on the page.
    You could create addition metafield for the Events. Then, add Literal control to ~\Sitefinity\ControlTemplates\Events\ContentViewItemList.ascx template.

    The bettor option is adding a new sfDesignSettings control  in ~\Sitefinity\Admin\ControlTemplates\Events\Design\EventsViewControlDesigner.ascx

    Example:

    <sfDesignSettings:TextSetting ID="TextSetting15"  
                          TargetID="Contact_Web"  
                          SettingTitle="Contact: Web"   
                          AllowLabelSetting="False"   
                          AllowFormatSetting="True"  
                          FormatType="String"  
                          AllowVisibilitySetting="True"  
                          TargetVisibleByDefault="True">  
    </sfDesignSettings:TextSetting> 

    When you edit mode, from Settings tab, you will be able to choose which fields you want to see on the page and which you do not.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Stanimira
    Stanimira avatar
    12 posts
    Registered:
    30 Jan 2009
    02 Feb 2009
    Link to this post
    Hello Ivan,

    Thank you very mich for your answer.

    Just to make sure that you understand my question properly:

    I would like to add columns "event start date" and "event category" to the events list, not to only one event. Also I would like to sort the list by "event start date".
    (I can upload a screenshot if you need, but I do not have such option.)

    I would like to use this option:
    "adding a new sfDesignSettings control  in ~\Sitefinity\Admin\ControlTemplates\Events\Design\EventsViewControlDesigner.ascx
    "
    1. Where exactly in the file I have to add this new control?

    2. What do you mean by edit mode? Edit mode of one event only? Or edit mode of the event list (I do not know if there is such.)?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    02 Feb 2009
    Link to this post
    Hello Stanimira,

    Are these fields custom ones, or they are the embedded ones -  columns "event start date" and "event category" to the events list"

    There are the same metafields in the module. They can be shown/ hidden on the public part of the website when you enter in edit mode of EventsView control, Settings Tab.

    I would like to use this option:
    "adding a new sfDesignSettings control  in ~\Sitefinity\Admin\ControlTemplates\Events\Design\EventsViewControlDesigner.ascx


    This option should be used if you want to add custom fields under events. You could add new control under  <DetailSettings> tags if you want to see it on the  event page. For every event in the list page you should change <MasterSettings>

    If you want you could send us a screenshot with the desired result.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Stanimira
    Stanimira avatar
    12 posts
    Registered:
    30 Jan 2009
    03 Feb 2009
    Link to this post
    Hello Ivan,

    I would like to show these details not in the public website, but in the administrative area.

    It is necessary to be able to sort the events and view the details, so that the website administrators will be able to find and edit last events.

    I am sorry for the stupid question, but how can I send you a screenshot. I am affraid I do not have rights for using Image Manager and uploading files.

    Best Regards,

    Mira
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    03 Feb 2009
    Link to this post
    Hi Stanimira,

    Ok, I got it now. I thought that you were talking about the front end.

    To achieve desired functionality please open the following template:
    ~\Sitefinity\Admin\ControlTemplates\Events\ControlPanelList.ascx

    Put the highlighted code in the template.

        <ItemTemplate> 
                            <asp:Label ID="statusMessage" runat="server" CssClass="stat"></asp:Label> 
                        </ItemTemplate> 
                    </asp:TemplateField> 
                    <asp:BoundField DataField="Event_Start" HeaderText="Event start" SortExpression="Event_Start DESC" /> 
                    <asp:BoundField DataField="Publication_Date" HeaderText="Event Publication Date" SortExpression="" /> 
                </Columns> 
     
    By doing so we are adding a new data field to the template and set SortExpression in DESC. Additionally you can Publication_Data or any of the other metafileds.

    I hope this helps.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. Stanimira
    Stanimira avatar
    12 posts
    Registered:
    30 Jan 2009
    03 Feb 2009
    Link to this post
    Thanks a lot, Ivan.

    This was what I needed to edit the events list in the admin area.

    Best Regards,

    Mira
  8. Alisha
    Alisha avatar
    23 posts
    Registered:
    09 Jun 2008
    25 Aug 2009
    Link to this post
    Does this solution work in 3.6? 
  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    25 Aug 2009
    Link to this post
    Hi Alisha,

    The solution does not work for versions prior 3.6, because we started using client side binding. Below are changes that you should do to get the same behavior in Sitefinity 3.6 .

    EventsItemsList.ascx

    ........ 
         ........ 
     
    <telerik:ClientTemplatesHolder ID="GridTemplates" runat="server"
            <telerik:ClientTemplate Name="Edit" runat="server"
                <href="<%= ((Telerik.Events.WebControls.Admin.EventsItemsList)Parent.Parent).ItemEditUrl %>"><asp:Literal ID="Literal7" Text="<%$ Resources:Edit %>" runat="server" /></a
            </telerik:ClientTemplate> 
            <telerik:ClientTemplate Name="Delete" runat="server"
                <href="javascript:if(confirm('<%= GetLocalResourceObject("AreYouSure_Delete") %>')) DeleteContent('{#ID#}')"><asp:Literal ID="Literal1" Text="<%$ Resources:Delete %>" runat="server" /></a
            </telerik:ClientTemplate> 
            <telerik:ClientTemplate Name="View" runat="server"
                <href="<%= ((Telerik.Events.WebControls.Admin.EventsItemsList)Parent.Parent).ItemViewUrl %>">{#MetaFields.Title#}</a> 
            </telerik:ClientTemplate> 
            <telerik:ClientTemplate Name="Title" runat="server"
                {#MetaFields.Title#} 
            </telerik:ClientTemplate> 
            <telerik:ClientTemplate Name="Status" runat="server"
                {#Status#} 
            </telerik:ClientTemplate> 
            <telerik:ClientTemplate Name="Event_Start" runat="server"
                {#MetaFields.Event_Start#} 
            </telerik:ClientTemplate> 
        </telerik:ClientTemplatesHolder> 
        <div id="gridPlaceholder"
        <telerik:RadGrid ID="ItemsGrid" runat="server" AutoGenerateColumns="false" AllowSorting="true" AllowPaging="true" PageSize="50" EnableViewState="false" Skin="SitefinityItems" EnableEmbeddedSkins="false" AllowMultiRowSelection="true"
            <MasterTableView AllowMultiColumnSorting="false" CssClass="listItems listItemsBindOnClient" Width="98%"
                <Columns> 
                    <telerik:GridTemplateColumn UniqueName="Edit" ItemStyle-CssClass="gridActions edit" /> 
                    <telerik:GridTemplateColumn UniqueName="Delete" ItemStyle-CssClass="gridActions delete" /> 
                    <telerik:GridClientSelectColumn UniqueName="CheckBoxColumn" HeaderStyle-CssClass="check" ItemStyle-CssClass="check"
                    </telerik:GridClientSelectColumn> 
                    <telerik:GridTemplateColumn  
                        UniqueName="View"   
                        SortExpression="Title"  
                        ItemStyle-CssClass="gridContentTitle" 
                        HeaderText="<%$ Resources:Title %>"
                    </telerik:GridTemplateColumn> 
                    <telerik:GridTemplateColumn  
                        UniqueName="Status"   
                        HeaderText="<%$ Resources:Status %>"
                    </telerik:GridTemplateColumn> 
                    <telerik:GridTemplateColumn  
                        UniqueName="Event_Start"   
                        HeaderText="Event_Start"
                    </telerik:GridTemplateColumn> 
                </Columns> 
            </MasterTableView> 
     
     
         .......    
     
              ....... 
     
    function DataBindGrid(currentPageIndex, pageSize, sortExpressionsAsSQL, filterExpressionsAsSQL) { 
        var requiredMetaFields = ['Title', 'Event_Start']; 
        var cultureInfoField = document.getElementById('<%= cultureInfoField.ClientID %>'); 
        Telerik.Cms.Engine.Services.ContentService.GetContentItems(currentPageIndex * pageSize, pageSize, 
        sortExpressionsAsSQL, filterExpressionsAsSQL, requiredMetaFields, cultureInfoField.value, dataProviderName, updateGrid, OnFailed); 

    I hope this helps.

    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. Alisha
    Alisha avatar
    23 posts
    Registered:
    09 Jun 2008
    28 Aug 2009
    Link to this post
    For some reason I have two copies of this file in two different folders.

    Question 1- Should I have two copies, and if so which do I edit

    Question 2 - I have edited both copies with the changes you provided but the changes aren't appearing.

    Sorry, I am still trying to figure out the new structure in 3.6!

    Thanks!
  11. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 Aug 2009
    Link to this post
    Hi Alisha,

    1. The file should be located under Sitefinity/Admin/ControlTemplates/Events.
    2. This template should be mapped - how to map a template
    3. More detailed information about the new architecture can be found at new backend architecture TOC ( all topics are migrated to chm version of Sitefinity developers manual.

    Regards,
    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
11 posts, 0 answered