Changing date format on Comments

Posted by Community Admin on 04-Aug-2018 23:38

Changing date format on Comments

All Replies

Posted by Community Admin on 21-Nov-2011 00:00

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.

Posted by Community Admin on 24-Nov-2011 00:00

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

Posted by Community Admin on 24-Nov-2011 00:00

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.

 

 

 

 

Posted by Community Admin on 25-Nov-2011 00:00

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

Posted by Community Admin on 25-Nov-2011 00:00

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,

This thread is closed