<!-- Gallery (all images from media folder, define by creating gallery doctype page under DKV_side to display on) --> <xsl:template match="DKV_Galleri"> <xsl:variable name="mediaFolderId" select="number(mediaFolderId)" /> <xsl:variable name="thumbWidth" select="number(110)" /> <xsl:variable name="thumbHeight" select="number(110)" /> <xsl:variable name="mrker" select="dkvmrker" /> <!-- Displays all images from a folder in the Media Library --> <xsl:if test="number($mediaFolderId)">
<xsl:for-each select="umbraco.library:GetMedia($mediaFolderId, true())/Image"> <xsl:if test="umbracoFile !=''"> <!-- build element div width avalible CMS-node classes for filtering and styling --> <div> <xsl:choose> <xsl:when test="string($mrker) = ''"> <xsl:attribute name="class"> element isotope-item Højde1 Bredde1 alle </xsl:attribute> </xsl:when> <xsl:otherwise> <xsl:attribute name="class"> element isotope-item Højde1 Bredde1 <xsl:value-of select="$mrker"/> </xsl:attribute> </xsl:otherwise> </xsl:choose> <a class="galleri" href="{umbracoFile}" title="{@nodeName}" rel="gallery"> <img src="/imageGen.ashx?image={umbraco.library:UrlEncode(umbracoFile)}&width={$thumbWidth}&height={$thumbHeight}" width="{$thumbWidth}" height="{$thumbHeight}" alt="{@nodeName}" title="{@nodeName}" class="thumbnail" /> </a> </div> </xsl:if> </xsl:for-each>
</xsl:if>
</xsl:template> <!-- Gallery End --> <!-- Anything that is hidden in umbraco-navi(not published) is sent to this blank template --> <xsl:template match="*[umbracoNaviHide = 1]" /> </xsl:stylesheet>
I guess what's happening is that there are some (or even just a single) childnode that's not matched by a template, which causes a built-in template to kick in (check this slide for a short explanation) - and this will in turn just apply templates to it's own children and so on...
Try adding this template to see what's going on:
<!-- Debug template - will catch any Document Type not specifically matched -->
<xsl:template match="*[@isDoc]" priority="-1">
<div>
Unmatched element found: <xsl:value-of select="concat('<', name(), ' id="', @id, '">')" />
</div>
</xsl:template>
fairly expensive to replace my keyboard at any rate, since i splurged on a dinovo edge from logitech :)
Thanks again, this oversight on my part came to my attention just as i was preparing user-testing of content editing so this solution has really saved my ass.
Apply Templates Xpath Problem
Hi, I am loosing my mind over this problem with using template matching.
I am trying to get all direct children(but not descendants) of my currentpage in this XSLT macro.
However, what i get seems to be all decendants regardless of the Xpath set to child.
Umbraco version is 4.7.0
Please educate me :)
Hi Andreas,
I guess what's happening is that there are some (or even just a single) childnode that's not matched by a template, which causes a built-in template to kick in (check this slide for a short explanation) - and this will in turn just apply templates to it's own children and so on...
Try adding this template to see what's going on:
/Chriztian
Thank you so much, it looks like this was the problem, got 4 unmatched elements on the first run.
You sir have saved me a great amount of theoretical sanity points. hell, might have saved me a keyboard since i stopped slamming my fist into it.
Edit: Confirmed as the solution to the problem.
Awesome - keyboards can be hard to replace if you're used to a specific (now sold out model) :-)
It's a good day, then!
/Chriztian
fairly expensive to replace my keyboard at any rate, since i splurged on a dinovo edge from logitech :)
Thanks again, this oversight on my part came to my attention just as i was preparing user-testing of content editing so this solution has really saved my ass.
is working on a reply...