I'm trying to use The Multi-node tree picker as a sort of gallery picker.
So on each page the user can select some pictures he/she wants to be displayed.
But it won't display the pictures.
I've just used the standard code from the ucomponents codeplex page:
<xsl:template match="/">
<!-- uComponents: Multi-node Tree Picker - An XSLT example ===================================== The Multi-node Tree Picker data-type will provide XML data based on the nodes you have selected. In this example, the property alias name for the Multi-node Tree Picker is "treePicker". -->
<!-- First we check that the Multi-node Tree Picker has any nodeId values --> <xsl:if test="$currentPage/treePicker/MultiNodePicker/nodeId">
<ul id="images">
<!-- Loop through each of the nodeId values --> <xsl:for-each select="$currentPage/treePicker/MultiNodePicker/nodeId">
<!-- Since we only have the nodeId value, we need to get the actual content node using umbraco.library's GetXmlNodeById method --> <!-- If you prefer to use pure XPath, then used this: "$currentPage/ancestor-or-self::*[@isDoc and @level = 1]/descendant-or-self::*[@isDoc and @id = current()]" --> <xsl:variable name="node" select="umbraco.library:GetXmlNodeById(.)" />
<li>
<!-- Output the URL using umbraco.library's NiceUrl method --> <a href="{umbraco.library:NiceUrl(.)}"> <img src="/css/imgs/billeder/thumbs/hovogn.jpg" width="104" height="76" alt="" /> </a>
I'm working on a new media picker which can also select multiple items in 1 picker so it's perfect for a gallery. It also has an upload functionality. If you're interessted I can send you the RC.
Using The Multi-node Tree Picker
Hi
I'm trying to use The Multi-node tree picker as a sort of gallery picker.
So on each page the user can select some pictures he/she wants to be displayed.
But it won't display the pictures.
I've just used the standard code from the ucomponents codeplex page:
<xsl:template match="/">
<!--
uComponents: Multi-node Tree Picker - An XSLT example
=====================================
The Multi-node Tree Picker data-type will provide XML data based on the nodes you have selected.
In this example, the property alias name for the Multi-node Tree Picker is "treePicker".
-->
<!-- First we check that the Multi-node Tree Picker has any nodeId values -->
<xsl:if test="$currentPage/treePicker/MultiNodePicker/nodeId">
<ul id="images">
<!-- Loop through each of the nodeId values -->
<xsl:for-each select="$currentPage/treePicker/MultiNodePicker/nodeId">
<!-- Since we only have the nodeId value, we need to get the actual content node using umbraco.library's GetXmlNodeById method -->
<!-- If you prefer to use pure XPath, then used this: "$currentPage/ancestor-or-self::*[@isDoc and @level = 1]/descendant-or-self::*[@isDoc and @id = current()]" -->
<xsl:variable name="node" select="umbraco.library:GetXmlNodeById(.)" />
<li>
<!-- Output the URL using umbraco.library's NiceUrl method -->
<a href="{umbraco.library:NiceUrl(.)}">
<img src="/css/imgs/billeder/thumbs/hovogn.jpg" width="104" height="76" alt="" />
</a>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</xsl:template>
What i want is this:
<ul>
<li><a href="billeder/hovogn.jpg"><img src="billeder/thumbs/hovogn.jpg" width="104" height="76" alt="" /></a></li>
</ul>
Hi Daniel,
The example XSLT is based on MNTP as a content picker, not media picker - so you'll just need to modify the following:
Not too sure how to get the image thumbnail?
Cheers, Lee.
I'm working on a new media picker which can also select multiple items in 1 picker so it's perfect for a gallery. It also has an upload functionality. If you're interessted I can send you the RC.
Jeroen
Hi Lee,
The thumbs should be the same, just with some imagegen magic.
I'm able to save the xslt file with your changes, but on the page it just says error parsing blabla..
Hi Daniel,
Yeah - my bad ... got the GetMedia syntax wrong!
Cheers, Lee.
Jeroen:
I would very much like to have a look at that, is there any issues? Else i would like to use it on this production site actually :).
mail me at : web @ dhbiz.dk
Lee:
Cheers mate, will try it out :)
Lee:
It's working now, just got to sort out the thumb thing now :)
Thanks!
<xsl:attribute name="src">/umbraco/ImageGen.ashx?image=/{$media/umbracoFile}&width=104</xsl:attribute>
This was my best shot, got any other ideas guys? :)
Hi Daniel,
You were very close!!! Move the img path to use inline XPath:
Cheers, Lee.
Thanks again Lee :)
You're welcome! :-D
is working on a reply...