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

Forums / Developing with Sitefinity / Change "Thank You" text when user makes a comment.

Change "Thank You" text when user makes a comment.

11 posts, 0 answered
  1. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    31 Mar 2011
    Link to this post
    Currently with my install of my Sitefinity site, when a user makes a comment they see the text:

    "Thank you for the comment! Your comment must be approved first"

    Appear after they make their post. I would like to change this to:

    "Thank you for your comment. It has been forwarded to a moderator for review."

    I have changed all instaced of the old text, with my new text message in the resource files, however the old text message still appears on the site.

    I have noticed that the DLL files:

    Telerik.Blogs.dll

    Telerik.Cms.Engine.dll

    Telerik.Events.dll

    Telerik.Libraries.dll

    Telerik.News.dll


    Still have the old text in them.

    How do I change/recompile these .DLL files?

    I have tried to rebuild my Sitefinity project in Visual Studio 2010, but these .DLL files do not appear to be updated.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Mar 2011
    Link to this post
    Hi Lurch,

    The easiest way to do this is mapping the external template CommentsList.ascx ( How to map a template). There is a a placeholder with a label

    <asp:PlaceHolder ID="moderationHolder" runat="server" Visible="false">
        <p class="commentMessage">
            <asp:Literal runat="server" Text="<%$Resources:CommentMessageModeration %>"></asp:Literal>
        </p>
    </asp:PlaceHolder

    All you have to do is changing the text of the label.

    All the best,
    Ivan Dimitrov
    the Telerik team
  3. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    31 Mar 2011
    Link to this post
    Thanks for the advice. Sounds like the best way to go, as I want to keep the impact of my code changes to a minimum.

    Just another question following on from this. In the extending a control example, they used the news control with the host type of:

    hostType="Telerik.News.WebControls.Admin.NewsItemNew"

    So, what would it be for the blog?
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    31 Mar 2011
    Link to this post
    Hi Lurch,

    Here is the host type and template location. Note that you should restart the application after the changes to the config file.

    <viewSettings hostType="Telerik.Cms.Engine.WebControls.CommentsList" layoutTemplatePath="~/Sitefinity/ControlTemplates/Generic_Content/CommentsList.ascx" />

    All the best,
    Ivan Dimitrov
    the Telerik team
  5. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    01 Apr 2011
    Link to this post

    Thanks for the code, appreciate it. I applied your code change, then attempted to use the blog comment controls, but I see the original text still is being shown on the page.

    I do see that in the blogs folder, there is also a CommentsList.ascx file. Since this site was initially developed by a 3rd party, I am not sure what web control they used, so to test this I changed your sample code to the following:

    <viewSettings hostType="Telerik.Cms.Engine.WebControls.CommentsList" layoutTemplatePath="~/Infinity/ControlTemplates/Blogs/CommentsList.ascx" />

    However, now I am getting the following error:

    Server Error in '/' Application.
    --------------------------------------------------------------------------------

    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

    Requested URL: /Home.aspx/App_Data/Configuration/Telerik.Sitefinity.Configuration.ControlsConfig.xml
    --------------------------------------------------------------------------------

    I have double checked the path string and can confirm there is a CommentsList.ascx, in the path "~/Infinity/ControlTemplates/Blogs/", so I guess there is something wrong with my hostType value.

    Checking the codebehind for the CommentsList.ascx, I find the following registration:

    <%@ Register Assembly="Telerik.Cms.Engine" Namespace="Telerik.Cms.Engine.WebControls" TagPrefix="sfWeb" %>

    From this I believe that the hostType should be OK too, but I am not sure what is making this 404 error appear.

    Do you have any hints on what is next for me to do?

  6. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    01 Apr 2011
    Link to this post

    Well I have fixed that 404 error, by checking the path string and doing a full re-build of the entire project.

    However, the original text of the "Thank you" response is still from the original embedded version from the .DLL, not from the web control that I specified in the layoutTemplatePath.

    I think what I may have to do, is to create a new web control from scratch and attempt to use this one.

    Can you please detail any tutorials you may have, on how to do this?

    Also, is there anything in the Sitefinity CMS, that I might have to change, to get the listed web control to point to the layoutTemplatePath template?

    Just a reminder, I am using Sitefinity 3.7, SP2 at the moment and NOT version 4.

  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    05 Apr 2011
    Link to this post
    Hi Lurch,

    Can you put a dummy text in the mapped template and then restart the application. Then open a content item from the front end - where you see your single item with the comments form and check whether your dummy text is shown. If you do not see the dummy text, then the template is not mapped and the control still uses the embedded one.

    Kind regards,
    Ivan Dimitrov
    the Telerik team

  8. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    18 Apr 2011
    Link to this post

    I apologies for the delay in my reply, was caught up with the R15 upgrade to @Task code on the company web site.

    To the matter at hand. Thanks for the suggestion, but it didn't work. I tried changing the text in the HTML, and in the resource file, but no matter what I put there, it did not show up.

    I do see that in your path code:

    <viewSettings hostType="Telerik.Cms.Engine.WebControls.CommentsList" layoutTemplatePath="~/Infinity/ControlTemplates/Generic_Content/CommentsList.ascx" />

    That you are referring to the CommentsList.ascx file. However, the text that I want to change is on the ContentViewSingleItem.ascx file. I have tried to point your code to ContentViewSingleItem.ascx, but that too does not work.

    I had a look at your Infinity CMS reference page:

    http://www.sitefinity.com/help/developer-manual/telerik.cms.engine-telerik.cms.engine.webcontrols.commentslist.html

    and did not see anything to do with ContentViewSingleItem. So unless that functionality is bundled into CommentsList, I have a hunch I need to reference something to use the ContentViewSingleItem.ascx file, as opposed to what is in the DLL.

    At this stage my questions are:

    Should I update your link to try to reference ContentViewSingleItem.ascx? If so, what would be the hostType?

    Should I be doing anything with the Blogs folder? Since most of the changes I do see when I test my theories out, are from this folder and not generic_content.

    Is there any other way to over-ride the Blogs DLL?

  9. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    19 Apr 2011
    Link to this post
    Hello Lurch,

    Please take a look at attached video.

    Greetings,
    Ivan Dimitrov
    the Telerik team

  10. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    19 Apr 2011
    Link to this post
    Thanks for that, the video did highlight what I was missing. I was taking a purely programming approach and updating the files in Visual Studio, trying to use the config file and web control code to set the path, and not going into Sitefinity itself, to update the link in the appearance box.

    So now I've got that message updating as intended, and all is working well.

    Thanks again for sticking it out with me, I really got a lot of useful Infinity experience with this one issue. :)
  11. Lurch
    Lurch avatar
    64 posts
    Registered:
    18 Jan 2011
    12 Mar 2012
    Link to this post

    Apologies for dragging this issue up again, but I've hit is problem with another Blog, and the fix that I used successfully in the past is now NOT working.

    As in your video I set up the "SingleItemTemplatePath" field to point to my new template .ascx file, which has the new code to show the "Thank you" message with the comment. I also ensure the resource files hold the new text (Later I hard coded the text into the HTML, as I was getting desperate.)

    Now, when I recompile the site and restart the web server, I see that the default "Thank you" text is displayed, and not the text that I have in my template file.

    The only difference between the two blogs, is in how the posts are displayed.

    The successful blog used the "List & Page" method, while the faulty blog uses the "One per page" method.

    Is there a difference between the two blogs, that would cause the external template code to behave differently?

    If so, what do I need to do?

Register for webinar
11 posts, 0 answered