Copied to clipboard

Flag this post as spam?

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


  • Shannon 148 posts 171 karma points
    Jan 29, 2011 @ 23:24
    Shannon
    0

    Editing blogroll variable to work in BlogPost.

    Currently I am using this XSLT to display my blogs number of comments, pageviews, and tags. How can I convert this to work in the Blogpost?

    <xsl:variable name="numberofcomments" select="count(BlogLibrary:GetCommentsForPost($post/@id)//comment)"/>
              <xsl:choose>
                <xsl:when test="$numberofcomments = 1">
                  <a href="{umbraco.library:NiceUrl(@id)}#comments">1 comment</a>
                </xsl:when>
                <xsl:otherwise>
                  <a href="{umbraco.library:NiceUrl(@id)}#comments">
                    <xsl:value-of select="$numberofcomments"/> comments
                  </a>
                </xsl:otherwise>
              </xsl:choose> &amp; <xsl:choose>
                <xsl:when test="$post/pageViewCount= 1">1 pageview
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="$post/pageViewCount"/> pageviews              
                </xsl:otherwise>
              </xsl:choose>}</small>
          </span>
          <span class="tags"><xsl:variable name="tags" select="tagsLib:getTagsFromNode(@id)" />
              <xsl:choose>
                <xsl:when test="count($tags/tags/tag) = 0">
                  Not tagged
                </xsl:when>
                <xsl:otherwise>
                  TAGS:
                  <xsl:for-each select="$tags/tags/tag">
                    <a href="{umbraco.library:NiceUrl($currentPage/ancestor-or-self::* [@isDoc]/Blog [@isDoc]/@id)}?filterby={.}" rel="tag">
                      <xsl:value-of select="."/>
                    </a>
                    <xsl:if test="position() != last()">, </xsl:if>
                  </xsl:for-each>
                </xsl:otherwise>
              </xsl:choose>
            </span>

    Thanks.

  • 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