Note that there are some explanatory texts on larger screens.

plurals
  1. POA variable passed on to a template is tampered with
    primarykey
    data
    text
    <pre><code>&lt;xsl:param name="currentPage"/&gt; &lt;xsl:param name="group-size" select="'2'" /&gt; &lt;xsl:template match="/"&gt; &lt;xsl:variable name="userBlogSource" select="umbraco.library:GetXmlNodeById(umbraco.library:GetDictionaryItem('WeblogNode'))/node [string(data [@alias='umbracoNaviHide']) != '1' and data[@alias='author'] = $currentPage/@id]" /&gt; &lt;xsl:for-each select="$userBlogSource"&gt; &lt;xsl:sort select="data[@alias='dato']" order="descending" /&gt; &lt;/xsl:for-each&gt; &lt;xsl:if test="count($userBlogSource) &amp;gt; 0"&gt; &lt;h3&gt;&lt;xsl:value-of select="umbraco.library:GetDictionaryItem('BlogpostsWrittenBy')"/&gt;&amp;nbsp;&lt;xsl:value-of select="$currentPage/@nodeName" /&gt;:&lt;/h3&gt; &lt;xsl:apply-templates select="$userBlogSource[(position() mod $group-size) = 1]" /&gt; &lt;ul&gt; &lt;xsl:for-each select="$userBlogSource"&gt; &lt;li&gt; &lt;a rel="bookmark" href="{umbraco.library:NiceUrl(@id)}" title="{@nodeName}"&gt; &lt;xsl:value-of select="@nodeName" /&gt; &lt;/a&gt; &lt;/li&gt; &lt;/xsl:for-each&gt; &lt;/ul&gt; &lt;/xsl:if&gt; &lt;/xsl:template&gt; &lt;xsl:template match="node"&gt; &lt;xsl:variable name="postnum" select="position()" /&gt; &lt;div class="weblog-posts-wrap"&gt; &lt;ul&gt; &lt;xsl:for-each select=". | following-sibling::node[position() &amp;lt; $group-size]"&gt; &lt;li&gt; &lt;a rel="bookmark" href="{umbraco.library:NiceUrl(@id)}" title="{@nodeName}"&gt; &lt;xsl:value-of select="@nodeName" /&gt; &lt;/a&gt; &lt;/li&gt; &lt;/xsl:for-each&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/xsl:template&gt; </code></pre> <p>When I check the count of $userBlogSource it contains three elements. When I attempt to print the in a regular XSLT for loop it does print the correct elements. But when the variable is passed to the second template matching node, the content is suddenly different. Instead of the three nodes it should contain, it contains 4 nodes by entirely different authors.</p> <p>Any idea of what I may be doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload