Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Feb 23, 2012 @ 13:26
    Fuji Kusaka
    0

    Comment Article of News

    Hi all,

    Is it possible to add a comment per Article with only the "Comment textarea" under an intranet system in umbraco using contour.

    So far I created a Comment form in Contour and uses the {member.Name} to get the current login user which works well but how do use it per article?

    What is the best solution for implementing Comments under an intranet system?

    //fuji

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Feb 23, 2012 @ 14:44
    Tom Fulton
    1

    Hi Fuji,

    I think there is a tutorial for this somewhere, but the best I could find is this video:  Umbraco Contour, making a comment function

    Basically you would use an XSLT macro to display the comment submissions, using the Contour XSLT Extensions to get the comments per-page - ie umbraco.Contour:GetApprovedRecordsFromPage(nodeId)

    HTH,
    Tom

  • Fuji Kusaka 2203 posts 4220 karma points
    Feb 24, 2012 @ 04:49
    Fuji Kusaka
    0

    Hi Tom,

    Thanks for the reply, well so far the comments are working. What needs to be  done is when displaying the news list only the first article will have a link to the comment form related to it something like (0) Comment, and after posting your comment i should increament to (1) and so ....

    For example .

    News 1
    Short Description
    (0) Comment  "This will be a link to the page article itself with the comment form in there"

    Now when you return to the previous page it should display the amount of comments
    News 1
    Short Description
    (1) Comment

    //fuji

  • Fuji Kusaka 2203 posts 4220 karma points
    Feb 24, 2012 @ 08:47
    Fuji Kusaka
    0

    Got it working....

    Instead i added it in my XSLT file

    <xsl:choose>
          <xsl:when test="position() = 1 ">
                       <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a><br/>      
                    <xsl:value-of select="umbraco.library:TruncateString(newsDesc, 200, '...')" disable-output-escaping="yes"/> <br/>
            <xsl:call-template name="comments" /><br/><br/>
           
          </xsl:when>
          
        <xsl:otherwise>
              <a href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a>
          <br/>
          <xsl:value-of select="umbraco.library:TruncateString(newsDesc, 100, '.')" disable-output-escaping="yes" />
          <br/>
        </xsl:otherwise>      
          
    </xsl:choose>
    </xsl:for-each>
    <!-- start writing XSLT -->

    </xsl:template>        
           
            <!-- Number  of Records -->
            <xsl:template name="comments">
              <xsl:variable name="records" select="umbraco.contour:GetApprovedRecordsFromPage(@id)"/>
               <xsl:choose>
                    <xsl:when test="count($records//uformrecord) = 0">
                      <a href="{umbraco.library:NiceUrl(@id)}"> (0) comments</a>
              </xsl:when>
            <xsl:when test="count($records//uformrecord) = 1">
              <a href="{umbraco.library:NiceUrl(@id)}">(1) comment </a>
            </xsl:when>
            <xsl:otherwise>
              <a href="{umbraco.library:NiceUrl(@id)}"> (<xsl:value-of select="count($records//uformrecord)"/>)  Comments</a>
            </xsl:otherwise>
          </xsl:choose>
            </xsl:template>
  • 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" link below.

Please Sign in or register to post replies