I have a page called hall of fame with a node id of 1185. This page is under the Homepage node like all the others.
This page allows images to be added as sub pages like this
>Homepage
>>> Hall of Fame >>>>> Image 1 >>>>> Image 2
etc etc
I need to show the umbracoFile thumbnail for all the images under
this node but I need to be able to add the macro anywhere on the site.
Its basically built like a gallery but without the individual gallery
folders.
Ive tried the following code but it only targets nodes directly under the root node:
I always found that if I was setting a Macro that relied on a paticular node it was quicker to access it directly by it's ID may well be the easiest way.
Adapted from your example something like the following
I needed to change the img src to <img src="/ImageGen.ashx?image={concat(substring-before(umbracoFile,'.'), '_thumb.jpg')}&width=140&height=94"/>
XSLT Help Please!
I have a page called hall of fame with a node id of 1185. This page is under the Homepage node like all the others.
This page allows images to be added as sub pages like this
>Homepage
>>> Hall of Fame
>>>>> Image 1
>>>>> Image 2
etc etc
I need to show the umbracoFile thumbnail for all the images under this node but I need to be able to add the macro anywhere on the site. Its basically built like a gallery but without the individual gallery folders.
<ul>
<xsl:for-each select="$hallNode/HallImages">
<xsl:sort select="jumpDate" order="descending"/>
<li>
<img title="{@nodeName}" src="{concat(substring-before(./*/umbracoFile,'.'), '_thumb.jpg')}" style="border: none;"/>
</li>
</xsl:for-each>
</ul>
Hey Roger,
Off the top of my head, your variable hallNode returns a node ID, not a node, so you need something like:
<xsl:for-each select="umbraco.library:GetXmlNodeById($hallNode)/HallImages">
Rich
Hey Roger,
I always found that if I was setting a Macro that relied on a paticular node it was quicker to access it directly by it's ID may well be the easiest way.
Adapted from your example something like the following
<!-- Node Locations -->
<xsl:variable name="hallNode" select="1050"/>
<!-- END Node Locations -->
<xsl:template match="/">
<ul>
<xsl:for-each select="umbraco.library:GetXmlNodeById(@id)//HallImages [@isDoc]">
<xsl:sort select="jumpDate" order="descending"/>
<li>
<img title="{@nodeName}" src="{concat(substring-before(./*/umbracoFile,'.'), '_thumb.jpg')}" style="border: none;"/>
</li>
</xsl:for-each>
</ul>
</xsl:template>
Hi Drew, that didn't work sorry. I changed the hallNode variable value to 1185, the id of the parent
Hi Rich,
Your code worked except for some reason the src of the image is only bringing back "_thumb.jpg" and not the actual value of the umbracoFile?
Thanks for the help
Roger
Ok, i've sorted it, thanks guys.
I needed to change the img src to <img src="/ImageGen.ashx?image={concat(substring-before(umbracoFile,'.'), '_thumb.jpg')}&width=140&height=94"/>
Thanks for all the help!
Roger
Glad we could help Roger
is working on a reply...