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

Forums / Developing with Sitefinity / Event View defaults

Event View defaults

2 posts, 0 answered
  1. Dave
    Dave avatar
    8 posts
    Registered:
    23 Apr 2008
    22 Jan 2009
    Link to this post
    I would like to control the default presentation of the Event View control when it is first placed onto a page.  I have been able to set the defaults for the "Step 3" settings that are part of the Event View settings wizard by making changes in the EventsViewControlDesigner.ascx.  However, I've also modified this same control to default the selected choices for Time (past, current, future events) as well as the default selection of presentation mode (new page, expandable, expanded list).  Although the control appears to use these defaults, the selected values immediately change to a system default upon initial placement of the Event View control on my page.  Can anyone explain how to set the defaults for Time and Presentation Mode?

    Thanks,
    Alan
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    23 Jan 2009
    Link to this post
    Hi Alan,

    Here is how to set some default settings:

    1. Set presentation mode - by default the presentation mode is set to List&page. If you want to have one of the other modes as default, the easiest way is to swap the places of the sfDesign:PresentationMode controls.

    Example: (here, the ExpandableList mode become on the first place and it is selected)
    ~\Sitefinity\Admin\ControlTemplates\Events\Design\EventsViewControlDesigner.ascx

    <sfDesign:PresentationModes ID="presentationModes" runat="server"
                        <Modes> 
            
                        <sfDesign:PresentationMode ID="ExpandableList" runat="server"  
                                                   ModeTitle="Expandable list"  
                                                   ModeSettingsId="ModesSettings2"  
                                                   MasterTemplatePath="~/Sitefinity/ControlTemplates/Events/Modes/ExpandableListMaster.ascx" 
                                                   CssClass="expandableList" 
                                                   SelectedCssClass="selectedOption expandableList" 
                                                   > 
                            <Template> 
                                    <asp:RadioButton ID="ExpandableListRadio" runat="server" /> 
                                    <p>A list of event titles and dates. The full info is expanded in the same list when a title is clicked.</p> 
                            </Template> 
                        </sfDesign:PresentationMode> 
                                     <sfDesign:PresentationMode ID="listPageMode" runat="server"  
                                                   ModeTitle="List &amp; page"  
                                                   ModeSettingsId="ModesSettings1"  
                                                   MasterTemplatePath="~/Sitefinity/ControlTemplates/Events/Modes/ListPageMaster.ascx"  
                                                   DetailTemplatePath="~/Sitefinity/ControlTemplates/Events/Modes/ListPageDetail.ascx" 
                                                   CssClass="pageListMode" 
                                                   SelectedCssClass="selectedOption pageListMode" 
                                                   > 
                            <Template> 
                                    <asp:RadioButton ID="listPageRadio" runat="server" /> 
                                    <p>A list of event titles, dates and summaries (optional). The full event info is opened in a separate page.</p> 
                                 
                            </Template> 
                        </sfDesign:PresentationMode> 
                         
                        <sfDesign:PresentationMode ID="allInAListMode" runat="server"  
                                                   ModeTitle="Expanded list"  
                                                   ModeSettingsId="ModesSettings3"  
                                                   MasterTemplatePath="~/Sitefinity/ControlTemplates/Events/Modes/AllPostsListMaster.ascx" 
                                                   CssClass="allInListMode" 
                                                   SelectedCssClass="selectedOption allInListMode"
                            <Template> 
                                    <asp:RadioButton ID="allPostsInAListRadio" runat="server" /> 
                                    <p>All events with their titles and the full info are in a common page.</p> 
                            </Template> 
                        </sfDesign:PresentationMode> 
                        </Modes> 
                    </sfDesign:PresentationModes> 

    2. As for the " Time", I am not sure what you mean. You can filter the Events that are being displayed using FilterExpression property ( Advanced >> Filters)

    Publication_Date <= "#now" AND Expiration_Date < "#now". This will list all past events
    Publication_Date <= "#now" AND Expiration_Date > "#now". This will list all current events
    Publication_Date > "#now" AND Expiration_Date > "#now". This will list all future events.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
2 posts, 0 answered