Copied to clipboard

Flag this post as spam?

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


  • aven 5 posts 26 karma points
    Jun 27, 2013 @ 21:23
    aven
    0

    Creating a simple commenting system to my blog posts

    Hello folks.. I could really use a hand with Umbraco.

    How do I create a blog where I and my visitors can post comments to the blog topic? I've been looking everywhere, on google, here and youtube to find somesort of guide. But I am lost. :)

    I have had a look at SurfaceController, but I dont know where to put the data? Is this the only way to create a commenting system? Or can I create these via document type/pages? I dont mind getting my hands abit dirty as I'm an old ASP.NET (Webforms) developer. And this seems like a good way to both learn abit Razor and MVC, the same time.

    So any of you who can give me some pointers? I just want to start simple with this. The documentation leaves me with more questions than answers, so maybe I have to start somewhere else?

    Kind regards, aven

  • Kevin Jump 2342 posts 14889 karma points MVP 8x c-trib
    Jun 27, 2013 @ 22:14
    Kevin Jump
    0

    you might want to build it yourself , but the uCommentsy package http://our.umbraco.org/projects/website-utilities/ucommentsy does this.

    I would install this package see if it does what you need and if not, all the code will be there so you can see how it has acheived it. 

  • Rich Green 2246 posts 4008 karma points
    Jun 27, 2013 @ 22:21
    Rich Green
    0

    Hey Aven,

    You could just use http://disqus.com/ if you want something simple :)

    Rich

  • aven 5 posts 26 karma points
    Jun 28, 2013 @ 08:12
    aven
    0

    Copy that. :)

    I'll try uCommentsy, see if the package contains what I need to create this on my own. I have thought of disqus. But I really want to progress my use with Umbraco. And learn in the making as I liiiike Umbraco's UI and simplicity :)

    Kind regards

  • aven 5 posts 26 karma points
    Jun 28, 2013 @ 14:03
    aven
    0

    Alright I partly solved my 'issue'. I guess :)

    Is it more correct to create a controller to do this form of submit via frontend? Or do it via the backend, creating a macro scripting file and add some document types? With this code in my scripting file:

    @using umbraco.MacroEngines

    @using umbraco.cms.businesslogic.web

    @{ 

        int root = int.Parse("1130")

        if (IsPost)

        {

            DocumentType dct = umbraco.cms.businesslogic.web.DocumentType.GetByAlias("Post");

            Document newSubscriber = Document.MakeNew(Request.Form["name"], dct, new umbraco.BusinessLogic.User(1), root);

            newSubscriber.getProperty("name").Value = Request.Form["name"];

            newSubscriber.Publish(new umbraco.BusinessLogic.User(0));

            umbraco.library.RefreshContent();

        }

    }

    <form action="@Model.Url" method="post">

        <div class="row">

            <div class="span1">

                Navn: 

            </div>

            <input type="text" name="name" value="" class="span3" />

        </div>

        <input type="submit" class="btn" name="tilmeld" value="Tilmed" />

    </form>

Please Sign in or register to post replies

Write your reply to:

Draft