More in this section

Forums / Developing with Sitefinity / Hide fields in the events module

Hide fields in the events module

3 posts, 1 answered
  1. Steven Lancaster
    Steven Lancaster avatar
    82 posts
    Registered:
    06 Nov 2009
    09 Feb 2010
    Link to this post
    I am wanting to hide certain fields when you look at a single event such as: Country and State what is the best way to do that?

    -Steven
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    09 Feb 2010
    Link to this post
    Hi Steven Lancaster,

    Thank you for using our services.

    You have two options for this. The first one would involve editing the specific instance of the Events View control and disable the the showing of desired fields (refer to attached image). This however would work for this particular instance of the control.

    The second option would allow you to this for all Events View controls. You have first to download the external templates for your version of Sitefinity. More information in this KB article: How to map a view to an external template, in Sitefinity 3.6 or later. Once you get the templates you should edit the templates located in ~/Sitefinity/Admin/ControlTemplates/Events/Modes/ and based on the desired presentation mode edit either of those:
    AllPostsListMaster.ascx
    ExpandableListMaster.ascx
    ListPageDetail.ascx

    The most common scenario would be to edit the ListPageDetail.ascx. You should remove the literals for displaying the City and Country:
    <asp:PlaceHolder id="plhWhere" runat="server">
         <address id="Location" runat="server" class="sf_eventLocation">
             Street: <asp:Literal ID="Street" runat="server" Text="{0}" /><br />
             City: <asp:Literal ID="City" runat="server" Text="{0}" /><br />
             State: <asp:Literal ID="State" runat="server" Text="{0}" /><br />
             Country: <asp:Literal ID="Country" runat="server" Text="{0}" /><br />
         </address>
    </asp:PlaceHolder>

    Then map the templates with the bellow configuration and restart your website:
    <viewSettings hostType="Telerik.Events.WebControls.EventsView">
      <additionalTemplates>
        <!--Item List-->
        <add key="ItemListTemplatePath" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Events/Modes/ListPageMaster.ascx" />
        <!--Single Item-->
        <add key="SingleItemTemplatePath" layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Events/Modes/ListPageDetail.ascx" />
      </additionalTemplates>
    </viewSettings>


    All the best,
    Radoslav Georgiev
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
    Answered
  3. Steven Lancaster
    Steven Lancaster avatar
    82 posts
    Registered:
    06 Nov 2009
    10 Feb 2010
    Link to this post
    Thank You that worked great!! It's Perfect!!

    --Steven
Register for webinar
3 posts, 1 answered