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

Forums / Bugs & Issues / Turn off Quotes in Forum

Turn off Quotes in Forum

23 posts, 0 answered
  1. Luke
    Luke avatar
    5 posts
    Registered:
    15 Jul 2008
    24 Jul 2008
    Link to this post
    I was wondering if it was possible to turn off the quote option in the Sitefinity forum module, or make it only appear when the user clicks on "reply." I have found that no matter what a user clicks, if they want to write something in a thread they must quote another post. I thought that once a thread gets long this quote could also get very long, thus posing a problem. Thanks for your time.
  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    28 Jul 2008
    Link to this post
    Hello Luke,

    This is possible.

    You should modify the control templates that are used by the Forums. For example, if you want to remove the Quotes editor in the public part, you should edit the file EditPost.ascx, which is located in \[YourProject]\Sitefinity\ControlTemplates\Forums. Here's the declaration of the Quotes editor that should be removed:

        <h3><asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Quote %>" /></h3
        <h4><asp:Literal ID="quoteAuthor" runat="server"></asp:Literal></h4
        <telerik:RadEditor  
            ID="tbQuote"  
            runat="server" 
            ToolsFile="~/Sitefinity/ControlTemplates/Forums/ToolsFile.xml" 
            Skin="Default2006" 
            Height="200px" 
            EditModes="Design,Html" 
            Width="95%"
            <CssFiles> 
                <telerik:EditorCssFile Value="~/Sitefinity/ControlTemplates/Forums/EditorCssFile.css" /> 
            </CssFiles>  
        </telerik:RadEditor> 

    You should make a similar change to the Administrative Forum templates if you want to remove this functionality there as well. This time, the file is ControlPanelEditPostTemplate.ascx and it is located in \[YourProject]\Sitefinity\Admin\ControlTemplates\Forums. Here's the code that should be removed:

    <h3><asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Quote %>" /></h3
    <fieldset class="set"
        <div class="setIn"
            <div> 
            <asp:Literal ID="quoteAuthor" runat="server"></asp:Literal> 
            <telerik:RadEditor  
                ID="tbQuote"  
                runat="server" 
                ContentAreaCssFile="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorContentArea.css" 
                ToolsFile="~/Sitefinity/Admin/ControlTemplates/Forums/StrippedToolsFile.xml" 
                EnableEmbeddedSkins="False" Skin="Sitefinity"  
                NewLineBr="False" 
                Height="175" 
                EditModes="Design,Html" 
                Width="95%">  
                <ImageManager ViewPaths="~/Images" UploadPaths="~/Images" DeletePaths="~/Images" /> 
                <MediaManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" /> 
                <FlashManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" /> 
                <DocumentManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" /> 
                <CssFiles> 
                    <telerik:EditorCssFile Value="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorCssFile.css" /> 
                </CssFiles>                     
            </telerik:RadEditor> 
            </div> 
        </div> 
    </fieldset> 

    You can also comment these lines. This will allow you to turn this functionality back on whenever you need.
    Don't hesitate to contact us if you have other questions.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Chris
    Chris avatar
    9 posts
    Registered:
    17 Aug 2007
    02 Sep 2008
    Link to this post
    Think you also need to do the same in ControlPanelCreatePostTemplate.ascx and it is also located in

     \[YourProject]\Sitefinity\Admin\ControlTemplates\Forums

  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    02 Sep 2008
    Link to this post
    Hello Chris,

    You need to modify ControlPanelCreatePostTemplate.ascx template only in case you want to remove the quote field in the administration also, but I think it would be useful to have it there.

    All the best,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. anand
    anand avatar
    59 posts
    Registered:
    11 Jun 2008
    15 Oct 2008
    Link to this post
    I am using Version 3 .2 SP2 Hotfix 1616 community edition and I want to turn Off quote option in forum during reply or post reply for each thread.

    I have tried to do this by commenting or removing following lines

        <h3><asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Quote %>" /></h3>
        <h4><asp:Literal ID="quoteAuthor" runat="server"></asp:Literal></h4>
        <telerik:RadEditor 
            ID="tbQuote" 
            runat="server"
            ToolsFile="~/Sitefinity/ControlTemplates/Forums/ToolsFile.xml"
            Skin="Default2006"
            Height="200px"
            EditModes="Design,Html"
            Width="95%">
            <CssFiles>
                <telerik:EditorCssFile Value="~/Sitefinity/ControlTemplates/Forums/EditorCssFile.css" />
            </CssFiles> 
        </telerik:RadEditor>

    But after commenting or removing these lines Nothing shows me in EditPost.ascx and only blank page will appear.

    Can any one help me.

    Thanks,
    Anand
  6. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    15 Oct 2008
    Link to this post
    Hi Anand,

    Thanks for contacting us.

    My co-worker's suggestion will remove the quote box from all future quotes, however, replies that have the quotes will not be removed automatically because they have already been written to the database. In this case, the quotes can either be edited or removed in the admin by following these instructions:

    1. Login to Sitefinity
    2. Go to Modules > Forums
    3. Click on the forum
    4. Click on the thread
    5. Click edit on a post
    6. Adjust the quote as you see fit

    I hope that this provides a solution for your technical issue. Feel free to contact us if you need further assistance.

    All the best,
    Joe
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  7. anand
    anand avatar
    59 posts
    Registered:
    11 Jun 2008
    15 Oct 2008
    Link to this post
    Hi Support,

    Thanks for your help
    but above solution will not work as I want to make quote completely Off in user section in forum.
    When I cmmented the above specified lines, But after commenting or removing these lines Nothing shows me in EditPost.ascx and only blank page appears.
    Please give me solution.

    Thanks,
    Anand

  8. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    15 Oct 2008
    Link to this post
    Hello Anand,

    Thanks for your reply.

    I am not sure if I understand your needs. Can you send me your code in an attachment? How about a screen shot of what you're trying to do and what is happening? Does the page have a theme? Using my suggestion, your screen should look like the attachment when all new quotes are added. Please see the attached code, which does turn off quotes for all future posts using reply and post reply.

    Sincerely yours,
    Joe
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  9. Joe
    Joe avatar
    138 posts
    Registered:
    24 Sep 2012
    24 Oct 2008
    Link to this post
    Hi Anand,

    I just wanted to follow up. Are you still having technical issues?

    Regards,
    Joe
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  10. anand
    anand avatar
    59 posts
    Registered:
    11 Jun 2008
    20 Nov 2008
    Link to this post
    I am still not able to Turn Quote completely Off in user section, please help me
    When I made following lines commented

    <!--
        <fieldset class="sf_forumsEditor">
            <div class="text">
                <asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Quote %>" />
            </div>
            <div class="text">
                <asp:Literal ID="quoteAuthor" runat="server"></asp:Literal>
            </div>
            <telerik:radeditor id="tbQuote" runat="server" toolsfile="~/Sitefinity/ControlTemplates/Forums/ToolsFile.xml"
                skin="Default2006" height="200px" editmodes="Design,Html" width="95%">
                <CssFiles>
                    <telerik:EditorCssFile Value="~/Sitefinity/ControlTemplates/Forums/EditorCssFile.css" />
                </CssFiles>
            </telerik:radeditor>
        </fieldset>
        -->

    I am getting javascript error "Sys.ArgumentException Value must be null for Controls and Behaviours.Parameter name:element" and my content editor got disabled.


  11. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    25 Nov 2008
    Link to this post
    Hello anand,

    I still cannot find anything wrong on my end when commenting out the lines in EditPost.ascx. Please note that comments starting with <!-- are not valid on server side - they are valid for html and javascript. You should use <%-- and --%> to comment your code in server side control templates.

    Greetings,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  12. Craig
    Craig avatar
    8 posts
    Registered:
    16 May 2008
    04 Dec 2008
    Link to this post
    This simply does not work.

    I'm running SiteFinity 3.5 SP1, and If I comment out the editor for the quote - the page fails to load the control anymore.

    As soon as you remove the "tbQuote" editor - the page fails. I'd imagine there's some hook in the compiled DLL that is expecting this control to exist.

    Is there another solution to this please?
  13. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    16 Dec 2008
    Link to this post
    Hi Craig,

    You could just set display: none; for the fieldset wrapping tbQuote editor like this:

    <fieldset class="sf_forumsEditor" style="display: none;"
         
        <h3><asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Quote %>" /></h3
        <h4><asp:Literal ID="quoteAuthor" runat="server"></asp:Literal></h4
        <telerik:RadEditor  
            ID="tbQuote"  
            runat="server" 
            ToolsFile="~/Sitefinity/ControlTemplates/Forums/ToolsFile.xml" 
            EnableEmbeddedSkins="True"  
            Skin="Default2006"  
            DialogsCssFile ="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorDialogs.css" 
            Height="200px" 
            EditModes="Design,Html" 
            Width="95%"
            <CssFiles> 
                <telerik:EditorCssFile Value="~/Sitefinity/ControlTemplates/Forums/EditorCssFile.css" /> 
            </CssFiles>  
        </telerik:RadEditor> 
    </fieldset> 

    Do let us know if this helps.

    Regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  14. anand
    anand avatar
    59 posts
    Registered:
    11 Jun 2008
    16 Dec 2008
    Link to this post
    Quote is still showing ( as visiblity is hidden) on Single Thread page, Is there any solution so that it will not visible on Single Thread page.
  15. Pepi
    Pepi avatar
    981 posts
    Registered:
    28 Oct 2016
    16 Dec 2008
    Link to this post
    Hi anand,

    It seems we cannot understand what exactly you want to achieve. Please, open a new support ticket and send us the modified version of EditPost.ascx public template and a screenshot illustrating which part of Single Thread page you need to remove.

    Thanks for your cooperation in advance.

    Regards,
    Pepi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  16. Craig
    Craig avatar
    8 posts
    Registered:
    16 May 2008
    16 Dec 2008
    Link to this post
    Unfortunately, none of the above solutions provide an elegant solution. We've come up with a solution that works for us - however, it may not work for you.

    First - you have to set the quote placeholder to a visibility of none. This will hide the quote editor on the edit of a post, but it will not resolve posts having quotes in them - it merely hides the ability to change them.

        <asp:PlaceHolder ID="phQuote" runat="server" Visible="false"
            <fieldset class="sf_forumsEditor"
                 
                <h3><asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Quote %>" /></h3
                <h4><asp:Literal ID="quoteAuthor" runat="server"></asp:Literal></h4
                <telerik:RadEditor 
                    ID="tbQuote"  
                    EnableResize="false" 
                    runat="server" 
                    ToolsFile="~/Sitefinity/ControlTemplates/Forums/ToolsFileBlank.xml" 
                    EnableEmbeddedSkins="True"  
                    Skin="Default2006"  
                    DialogsCssFile ="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorDialogs.css" 
                    Height="200px" 
                    EditModes="Preview" 
                    Width="100%"
                    <CssFiles> 
                        <telerik:EditorCssFile Value="~/Sitefinity/ControlTemplates/Forums/EditorCssFile.css" /> 
                    </CssFiles>  
                </telerik:RadEditor> 
            </fieldset> 
        </asp:PlaceHolder> 
     

    Secondly, you must override the submit button for the post. We have our own wrapper API for sitefinity to accomplish this, so you'd have to use SiteFinity's API instead to accomplish what we've done below:

        Protected Sub OnItemSave(ByVal Sender As Object, ByVal e As System.EventArgs) Handles saveButton2.Click 
             
            Dim threadId = Guid.Empty 
             
            If Me.PageMode = "editPost" Then 
                 
                Dim forumContext As New ForumContext() 
                Dim userContext As New UserContext() 
     
                If Not Me.ParentId.Equals(Guid.Empty) Then 
                     
                    If forumContext.IsPost(Me.ParentId) Then 
                        '  This is a post. 
                        Dim parentPost As Post = forumContext.GetPost(Me.ParentId) 
                        threadId = parentPost.ThreadId 
                        If Not parentPost Is Nothing Then 
                            ' Determine the currently logged in user. 
                            Dim currentUser As String = userContext.GetCurrentLoggedInUser(Page).UserName 
                         
                            If Not currentUser Is Nothing Then 
                                ' New post. 
                                Dim newPost As New Post() 
                                'newPost.ForumId = parentPost.ForumId 
                                newPost.Author = currentUser 
                                newPost.Status = Telerik.Forums.PostStatus.PostVisible 
                                newPost.Text = editor.Content 
                                forumContext.CreatePost(parentPost, newPost) 
                            End If 
                        End If 
                    Else 
                        ' This is a thread. 
                        Dim parentPost As Thread = forumContext.GetThread(Me.ParentId) 
                        threadId = parentPost.ID 
                        If Not parentPost Is Nothing Then 
                            ' Determine the currently logged in user. 
                            Dim currentUser As String = userContext.GetCurrentLoggedInUser(Page).UserName 
                         
                            If Not currentUser Is Nothing Then 
                                ' New post. 
                                Dim newPost As New Post() 
                                'newPost.ForumId = parentPost.ForumId 
                                newPost.Author = currentUser 
                                newPost.Status = Telerik.Forums.PostStatus.PostVisible 
                                newPost.Text = editor.Content 
                                forumContext.CreatePost(parentPost, newPost) 
                            End If 
                        End If 
                    End If 
                     
                ElseIf Not Me.PostId.Equals(Guid.Empty) Then 
                    ' Edit post. 
                    Dim editPost As Post = forumContext.GetPost(Me.PostId) 
                    threadId = editPost.ThreadId 
                     
                    If Not editPost Is Nothing Then 
                        editPost.Text = editor.Content 
                        forumContext.UpdatePost(editPost) 
                    End If 
                End If 
                 
            End If 
     
            ' Redirect. 
            If Not threadId.Equals(Guid.Empty) Then 
                Response.Redirect(Spitfire.Configuration.PathSettings.ForumPostsPage(threadId)) 
            End If 
             
        End Sub 
         
        Private ReadOnly Property PostId() As Guid 
            Get 
                Try 
                    Return New Guid(Request.QueryString("post")) 
                Catch ex As Exception 
                    Return Guid.Empty 
                End Try 
            End Get 
        End Property 
         
        Private ReadOnly Property ParentId() As Guid 
            Get 
                Try 
                    Return New Guid(Request.QueryString("parent")) 
                Catch ex As Exception 
                    Return Guid.Empty 
                End Try 
            End Get 
        End Property 
         
        Private ReadOnly Property PageMode() As String 
            Get 
                Return Request.QueryString("mode") 
            End Get 
        End Property 
     

    As you can see from above, most of the methods are coming from our own API that wraps the SiteFinity API.

    Essentially - we've put a "visible="false" on the pages submit button, and created a new one of which the above mehod fires up click.

    The above method then handles the addition and editing of posts - whereby we control what content goes into the post rather than sitefinity.

    1) We determine if the pagemode is "editPost". (In sitefinity's context, this means we're either adding or editing a post).

    2) We check the parentId querystring param. If it exists, we know we're replying to an existing post or thread.

    3) If we're replying, we create the new post with the correct thread and publish it.

    4) If we're editing (i.e. no parentId) then we update the posts content accordingly and publish it.

    The above solution works for us because it means new posts won't have a quote, and any existing posts that HAVE a quote (before the code was implemented) can merely be edited to remove the quote.

    It's worth noting that the above solution is not a copy and paste solution. You would need to modify our code to conform to the sitefinity API instead.

    In any case, I hope this helps someone with any logic should they require it.
  17. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    17 Dec 2008
    Link to this post
    Hello Craig,

    We have updated your account for sharing your solution with the community. Thank you!

    Kind regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  18. Jaycen
    Jaycen avatar
    13 posts
    Registered:
    29 Dec 2008
    29 Dec 2008
    Link to this post
    We just fired up forums on our sitefinity pages.  As a long time user of phpbb2, I'd love to see a lot more thrown at forums for sitefinity.

    I'm surprised you have to actually edit code to turn off the quoting function.  Most forums require the poster to choose to quote other posts.  This makes imminent sense for on-line communities.

    This is probably a stupid question, since I'm primarily a content provider for our site and not a developer, but I'm starting to get the picture that we've picked up something that is extremely flexible.  What that translates into is "you must code your own customizations" as opposed to "here's a lot of radio buttons and check boxes that allow you to select pre-configured customizations".

    Is that essentially correct?

    For instance, I struggled to find the "Post Reply" button on your forums at first because it's located outside of the gray box that holds the text editor, even though the "Subscribe me for this thread" check box is located inside.  I was looking for a button at the lower-right of the text editing area to hit for submitting the post.  I actually scrolled all the way down to find the button before coming back up and seeing it in it's own little area way over on the left side of the screen.  Very strange arrangement.

    If I wanted a more intuitive layout, we'd need to code that ourselves, or install a new theme/layout for the site?
  19. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    30 Dec 2008
    Link to this post
    Hi Jaycen,

    It really depends on the features you want, but for most of them, you will have to code it yourself. This is because the layout and themes are affecting the design, but not the functionality.

    We also think that the Forums module functionality is limited at the moment. That is why we are going to rewrite it. It will inherit from the new Generic Content Module which is much more flexible.

    Kind regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  20. Christopher
    Christopher avatar
    2 posts
    Registered:
    19 Jan 2009
    11 Feb 2009
    Link to this post
    Hi,

    In the code sample in this thread there is a line performing a redirect after a post edit.

    Response.Redirect(Spitfire.Configuration.PathSettings.ForumPostsPage(threadId))

    How can I access these properties so that I can redirect after my custom edit post code?

    Thanks,
    Chris
  21. Craig
    Craig avatar
    8 posts
    Registered:
    16 May 2008
    11 Feb 2009
    Link to this post
    Response.Redirect(Spitfire.Configuration.PathSettings.ForumPostsPage(threadId))

    The method:
    Spitfire.Configuration.PathSettings.ForumPostsPage(threadId)

    is simply a static method that reads a custom app setting from our web.config that defines the location of the thread replies page.

    The passed in threadId is determined via the querystring at runtime.

    You could essentially accomplish the above by the following;

    Response.Redirect("YourThreadReplyPage.aspx" + Request.QueryString("ThreadId"))
  22. Netfinity
    Netfinity avatar
    11 posts
    Registered:
    15 Nov 2006
    13 Aug 2009
    Link to this post
    For all those interested I have found a much much easier work around for completely turning off quotes in your Sitefinity forum(s)

    1. In the control template /Sitefinity/ControlTemplates/Forums/EditPost.ascx change the following line:

    <fieldset class="sf_forumsEditor">

    On the first fieldset which is where the previous post content is quoted to this:

    <fieldset class="sf_forumsEditor" style="display: none;">

    2. Add a code behind class to this control template

    3. In that code behind class paste the following code:

        protected void Page_PreRender(object sender, EventArgs e)
        {
            tbQuote.Content = string.Empty;
        }

    That's it. you're done.

    You can also do the same to your admin control templates as well if you like:

    /Sitefinity/Admin/ControlTemplates/Forums/ControlPanelCreatePostTemplate.ascx
    /Sitefinity/Admin/ControlTemplates/Forums/ControlPanelEditPostTemplate.ascx

    I only did the same to the create post template so that if any exiting posts had quotes in them the forum administrators could still clean them up.
  23. Rok
    Rok avatar
    7 posts
    Registered:
    08 Apr 2008
    01 Dec 2010
    Link to this post
    If you want to display the quote to the user, but not use it as a post field, so that he/she can see the posts thats being replied to, things get even weirder.

    you add another literal control:

    <

     

     

    asp:Literal ID="Literal1" runat="server"></asp:Literal>

     


    and sets its value:

     

     

    protected void Page_PreRender(object sender, EventArgs e)

     

    {

    Literal1.Text = tbQuote.Content;

    tbQuote.Content =

     

    string.Empty;

     

    }


    I am amazed how mouch work and stupid workarounds are required to get even basic functionality out of Sitefinity.
    It would me MUCH easyier if at least sitefinity stuff wouldnt be private or protected... :(
Register for webinar
23 posts, 0 answered