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

Forums / Developing with Sitefinity / Custom View Change

Custom View Change

3 posts, 1 answered
  1. thomas3577
    thomas3577 avatar
    22 posts
    Registered:
    18 Feb 2007
    06 Oct 2009
    Link to this post
    I always want to see the latest Content from a Category. I use the FilterExpression [Category = "Protokoll"] and the SortExpression [Publication_Date ASC].

    Now, i dont need "Comments" and the Link "All Content". I want only want to see the last Content.

    Is there an example of a custom content view?
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    06 Oct 2009
    Link to this post
    Hello thomas3577,

    Thank you for using our services.

    For those purposes you can use external templates. Depending on the content view that you are using to display the list of your content items (being a Generic Content View, News View, etc) you can edit the list view to remove the controls for displaying those fields. Take for example Generic Content view. The control template for the list mode is ~/Sitefinity/ControlTemplates/Generic_Content/ContentViewItemList.ascx, open it and remove the fields:
      <class="sf_readMore"
                    <asp:HyperLink ID="fullContent2" runat="server"
                        <asp:Literal ID="Literal1" runat="server" Text="<%$Resources:FullStory %>"></asp:Literal> 
                    </asp:HyperLink> 
                </p> 
                <div class="sf_contentComments"
                    <asp:HyperLink ID="CommentsLink" runat="server" NavigateUrl="{0}#comments"
                        <asp:Label ID="CommentsCount" runat="server"></asp:Label> 
                        <asp:Literal Text="<%$Resources:Comments %>" runat="server"></asp:Literal> 
                    </asp:HyperLink> 
                </div> 

    Then all you need to do is make the particular content view use the template. You have two options, either to map it in the controls config file and make all content views of that type on your site use it, or through the control editor set the ItemListTemplatePath property.

    Regards,
    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.
    Answered
  3. thomas3577
    thomas3577 avatar
    22 posts
    Registered:
    18 Feb 2007
    06 Oct 2009
    Link to this post
    Thanks :-)
Register for webinar
3 posts, 1 answered