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

Forums / Bugs & Issues / Changing date format on Comments

Changing date format on Comments

5 posts, 0 answered
  1. Nimit
    Nimit avatar
    90 posts
    Registered:
    27 Mar 2009
    21 Nov 2011
    Link to this post
    Hi There,
    I am working on a website on Siteifnity 4.2 and our customer wants to change the date format showing on the comments of News.
    I tried to do the same as defined in the following link :--> http://www.sitefinity.com/devnet/forums/sitefinity-4-x/developing-with-sitefinity/changing-date-format-on-news-comments.aspx.
    but it is not reading the template.

    Please reply and guide me to the right direction.

    Regards,
    Nimit Verma.
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    16 Aug 2017
    24 Nov 2011
    Link to this post
    Hi Nimit,

    You'll need to map the template for Telerik.Sitefinity.Modules.GenericContent.Web.UI.Views.CommentsMasterView. Please find the below template we're using and the corresponding element responsible for the date format of the comments on the list highlighted:
    <%@ Control Language="C#" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI.ContentUI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="sf" Namespace="Telerik.Sitefinity.Web.UI" Assembly="Telerik.Sitefinity" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
     
    <telerik:RadListView ID="commentsList" ItemPlaceholderID="ItemsContainer" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false">
        <LayoutTemplate>
            <div class="sfcommentsListWrp">
                <h2 id="comments" class="sfcommentsTitle">
                    <asp:Literal ID="comments" runat="server" />
                </h2>
                <ol class="sfcommentsList">
                    <asp:PlaceHolder ID="ItemsContainer" runat="server" />
                </ol>
            </div>
        </LayoutTemplate>
        <ItemTemplate>
            <li id="commentContainer" runat="server" class="sfcommentDetails">
                <asp:Label ID="itemIndex" runat="server" CssClass="sfcommentNumber" />
                <strong class="sfcommentAuthor">
                    <sf:SitefinityHyperLink ID="website"  Text='<%# Eval("AuthorName") %>' NavigateUrl='<%# Eval("Website") %>' runat="server" Target="_blank" />
                    <asp:Literal ID="authorName"  Text='<%# Eval("AuthorName") %>' runat="server" />
                </strong>
                <em class="sfcommentDate">
     
                <sf:FieldListView ID="dateCreated" runat="server" Format="{DateCreated.ToLocal():dd MMM}" />
                </em>
                <div class="sfcommentText">
                    <asp:Literal ID="content" Text='<%# Eval("Content") %>' runat="server" />
                </div>
            </li>
            test
        </ItemTemplate>
    </telerik:RadListView>


    Regards,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Nimit
    Nimit avatar
    90 posts
    Registered:
    27 Mar 2009
    24 Nov 2011
    Link to this post
    Hi Boyan Barnev,
    Thank you for your reply.
    I copied the code and create a page called "CommentsListView.ascx" and then changed the "ControlsConfig.config"  to

    <viewMap>

     

    <

     

     

    viewSettings layoutTemplatePath="~/App_Data/CustomControls/CommentsListView.ascx" hostType="Telerik.Sitefinity.Modules.GenericContent.Web.UI.Views.CommentsMasterView" />

     

    </

     

     

    viewMap>

    When I reload the news item the comments section is disappeared.

    Please Guide me what should be done.

    Regards,
    Nimit Verma.

     

     

     

     

  4. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    16 Aug 2017
    25 Nov 2011
    Link to this post
    Hello Nimit,

    Can you please let us know if you have built the project after applying the custom template, and restarted the application so the new configuration settings can take effect? Please find attached a short video demonstrating how the functionality is setup on my local project.

    Kind regards,
    Boyan Barnev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Nimit
    Nimit avatar
    90 posts
    Registered:
    27 Mar 2009
    25 Nov 2011
    Link to this post
    Hi Boyan,
    I am still having issues in showing the comments.

    So, I have to create a ticket with the ID: 486817 where I have uploaded a video on what is happing.

    Please have a look and guide me .

    Regards,
    Nimit Verma,
5 posts, 0 answered