Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Frans de Jong 522 posts 1762 karma points c-trib
    Feb 11, 2016 @ 10:17
    Frans de Jong
    0

    Comments plugin without Disqus

    Hi All,

    I'm asked to build a intranet using umbraco. I don't think it's a problem, but the only thing I'm missing is a way to comment on a contentnode. For normal websites we use Discus, but for a intranet we'd like to keep the comments inside umbraco.

    In the past I used a package called ucommentsy, but that's not realy supported anymore.

    Does anybody know of a way/package that supports comments in umbraco?

    Thanks,

    Frans

  • Tom Engan 430 posts 1173 karma points
    Feb 11, 2016 @ 14:00
    Tom Engan
    2

    In document types, I've added a new property:

    • Name: Disqus comments
    • Alias: disqusComments
    • Type: True/False

    Then I added a partial view named DisqusComments:

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    <div id="disqus_thread"></div>
    <script>
        /**
        * RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
        * LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables
        */
        /*
        var disqus_config = function () {
        this.page.url = @Umbraco.RenderMacro("canonicalUrl"); // Replace PAGE_URL with your page's canonical URL variable
        this.page.identifier = '@Model.Content.Id'; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
        };
        */
        (function () { // DON'T EDIT BELOW THIS LINE
            var d = document, s = d.createElement('script');
    
            s.src = '//YOURDISQUESPROFILE.disqus.com/embed.js';
    
            s.setAttribute('data-timestamp', +new Date());
            (d.head || d.body).appendChild(s);
        })();
    </script>
    <noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript" rel="nofollow">comments powered by Disqus.</a></noscript>
    

    Then add to the template:

    @{
       if (Model.Content.GetPropertyValue<bool>("disqusComments"))
       {@Html.Partial("DisqusComments")}
    }
    

    Then add to the master template:

    <script async src="//YOURDISQUESPROFILE.disqus.com/count.js" id="dsq-count-scr"></script>
    

    https://disqus.com/api/docs/

  • Frans de Jong 522 posts 1762 karma points c-trib
    Feb 11, 2016 @ 14:07
    Frans de Jong
    0

    Hi Tom,

    Thanks for your answer but I'm looking for a solution without using disqus.

    Kind regards,

    Frans

  • Tom Engan 430 posts 1173 karma points
    Feb 11, 2016 @ 14:09
    Tom Engan
    1

    Oh, sorry I've just read it the right way now. Maybe some other can use this solution :-)

  • Frans de Jong 522 posts 1762 karma points c-trib
    Feb 11, 2016 @ 14:12
    Frans de Jong
    0

    It's a nice solution.

    I use it like that on websites, but I like something within umbraco for the intranet.

  • Tom Engan 430 posts 1173 karma points
    Feb 11, 2016 @ 14:49
    Tom Engan
    1

    What about a contact form only for Umbraco users listed with all child items inside only umbraco backoffice?

    I followed five videos from here, included the last one "Dropdowns and preValues - Listing the question "and it works quite well. Could a solution similar this work, or might the rebuilding to comment on a contentnode too extensive?

    https://www.youtube.com/watch?v=e7UeXUtpjck&list=PLLYO0Qmbv5pvGjpI6Cyg3mVBoYtG_LK63&index=9

    enter image description here

  • Frans de Jong 522 posts 1762 karma points c-trib
    Feb 11, 2016 @ 16:37
    Frans de Jong
    0

    It feels a little bit like a misuse of content nodes. What happens when I van to have comment possibilities on a page that already has children?

    It can be a last resort.

    Thanks for the help!

  • Tom Engan 430 posts 1173 karma points
    Feb 11, 2016 @ 16:51
    Tom Engan
    0

    Good question, and I see your point (especially if content nodes is not defined as a list), and I haven't tried to modify something on this solution. Perhaps it is too extensive (but I think it's an good educational example of how you can integrate your own .NET experiences into Umbraco CMS).

  • Nik 1413 posts 6212 karma points MVP 3x c-trib
    Feb 11, 2016 @ 16:56
    Nik
    1

    Don't store them as content nodes, well, it's not recommended that's for sure. Each time you create a comment it would "publish" which would redo the cache. Just imagine how big your cache will get.

    Create a custom database table (or use a PetaPeco class) and have nodeId and MemberId as properties (along with comment text of course).

    Then create your own form which posts to a surface controller and saves said information to the database.

    You can create a custom section for the back office to display all of the comments in a tabular format for review if you wanted to.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" button below.

    Continue discussion

Please Sign in or register to post replies