Home  ›  BLOG  ›  2010  ›  3  ›  18  ›  Debugging the Umbraco Tag Cloud package
Debugging the Umbraco Tag Cloud package
Donnerstag, 18. März 2010, Christoph Ertl

tag cloudDebugging the Umbraco Tag Cloud package would be great. But it’s not possible and not necessary.
However, one thing is really helpful when having problems with the counted nodes. Checking which nodes are counted.

Over time I’ve got repeated mails regarding having problems with counting the nodes. The problem often was a wrong or misunderstood result of the xpath expression. The “problem” with the RenderTags method is, that it just returns a result and you have no glue which nodes where counted.

A very easy way to check if your statements counts the nodes you want to count is the following.

After your code for the cloud

<xsl:value-of
 
select="TagCloud.Helper:RenderTags($currentPage/..., 'categories', '', 6)"

 
disable-output-escaping="yes"
/>

you place a for-each with the xpath statement you pass as first parameter to RenderTags.

<xsl:for-each select="$currentPage/...">
  <
xsl:value-of select="current()/@nodeName"/><br
/>
</
xsl:for-each
>

With this code you get a list of nodes which are calculated within the tag cloud calculator. There you should see where the problem is located.

ATTENTION: It is very important that you place this code at the same template where the tag cloud code is placed because the result depends on the node this template is executed on. It’s all about the hierarchy of your nodes!


0 Kommentare für “Debugging the Umbraco Tag Cloud package”

    Leave a comment


    Not shown. Will only display your Gravatar picture from http://www.gravatar.com/


    (optional - remember http://)


    Enter the characters from the image. (used to avoid spam posts)