Can you specify the problem a little bit. Do you get nothing displayed at all? Or are the images showing but with wrong links? Are your images direct nodes under your current page, or are these media items?
If I understand correctly, you have a property on your document in which you can specify the media folder to associate to the document. I assume the name of that property is MyMediaFolder. It actually contains the Id (int) of the media folder. And then this media folder contains one (or more?) images that you want to display in your gallery.
I am no XSLT expert so I can't pull out the exact code like that, but I think this is what your XSLT should look like, in pseudo-code:
<!-- display each image in the row, with the count of photos in each gallery --> <li> <ahref="{umbraco.library:NiceUrl(@id)}"> <divclass="photo"> <!-- Added pseudo-code -->
Thumbnail gallery not showing
Please help, im trying to show the thumbnail on my gallery
This is the thumbail path showing http://somedomain.com/_thumb.
What am i missing? Thanks much.
Hi Frost,
Can you specify the problem a little bit. Do you get nothing displayed at all? Or are the images showing but with wrong links? Are your images direct nodes under your current page, or are these media items?
Cheers,
Michaƫl.
Oh sorry, images are not displayed http://i.imgur.com/1wN8a.jpg
im using getmedia like this http://i.imgur.com/Ghui4.jpg
and im getting the media here http://i.imgur.com/BS1Ap.jpg
Hi Frost,
If I understand correctly, you have a property on your document in which you can specify the media folder to associate to the document. I assume the name of that property is MyMediaFolder. It actually contains the Id (int) of the media folder. And then this media folder contains one (or more?) images that you want to display in your gallery.
I am no XSLT expert so I can't pull out the exact code like that, but I think this is what your XSLT should look like, in pseudo-code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp " ">
]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
<xsl:outputmethod="xml"omit-xml-declaration="yes"/>
<xsl:paramname="currentPage"/>
<xsl:variablename="imagesPerRow"select="6"/>
<!-- =============================================================== -->
<xsl:templatematch="/">
<ul>
<xsl:for-eachselect="$currentPage/* [@isDoc]">
<!-- display each image in the row, with the count of photos in each gallery -->
<li>
<ahref="{umbraco.library:NiceUrl(@id)}">
<divclass="photo">
<!-- Added pseudo-code -->
<xsl:variablename="mediaFolderId" select="./MyMediaFolder"/>
With this var, which now contains the Id of the media folder, you have to call a library method to get the actual media folder, so something like
<xsl:variable name="mediaFolder" select="Library.GetMediaFolderById($mediaFolderId)"/>
Then you need to loop through all images under the mediaFolder to get all images, so something like
<xsl:for-eachselect="$mediaFolder/* "> <!-- Or maybe add some filter like [@isDoc] -->
<xsl:variablename="ext"select="concat('.', umbracoExtension)"/>
<imgsrc="{concat(substring-before(umbracoFile,'.'), '_thumb', $ext)}"alt="{@nodeName}"/>
</xsl:for-each>
</div>
<spanclass="name">
<xsl:value-ofselect="@nodeName"/>
</span>
</a>
<spanclass="meta">
<xsl:value-ofselect="count(./* [@isDoc])"/>
<xsl:text>Photo</xsl:text>
<xsl:iftest="count(./* [@isDoc]) > 1">
<xsl:text>s</xsl:text>
</xsl:if>
</span>
</li>
</xsl:for-each>
</ul>
</xsl:template>
<!-- =============================================================== -->
</xsl:stylesheet>
I hope this helps you get on the right track.
Cheers,
Michael.
Sorry for the formatting, it was messed up when posted... And edit mode does not do better :-S
Cheers,
Michael
is working on a reply...