Ok, let me start with I've read a few posts but nothing seems to be working for me. I'm using 4.5.2.
I've created a directory under media named "PhotoGallery". I intend to use this to store images here for my gallery. I started by looking into some other forums and such. I added a media picker to my page and selected "PhotoGallery" from the media picker. I have two photos under this directory in the Media section. Below is my xslt. 1074 is the ID for the "PhotoGallery" media node. I'm getting nothing returned.
I've created the Digibiz Advanced Media Picker. With this new media picker you can store multiple items in 1 picker which is perfect for creating a photo gallery. You can watch a very simple photo gallery sample here: http://screenr.com/TEY.
Retrieving Media Items for Photo Gallery
Ok, let me start with I've read a few posts but nothing seems to be working for me. I'm using 4.5.2.
I've created a directory under media named "PhotoGallery". I intend to use this to store images here for my gallery. I started by looking into some other forums and such. I added a media picker to my page and selected "PhotoGallery" from the media picker. I have two photos under this directory in the Media section. Below is my xslt. 1074 is the ID for the "PhotoGallery" media node. I'm getting nothing returned.
<xsl:for-each select="umbraco.library:GetMedia(1074, 'true')/node">
<li>
<a class="image" rel="gallery">
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:GetMedia(@id, 'false')/data [@alias='umbracoFile']"/>
</xsl:attribute>
<img>
<xsl:attribute name="src">
<xsl:value-of select="Exslt.ExsltStrings:replace(umbraco.library:GetMedia(@id, 'false')/data [@alias='umbracoFile'], '.', '_thumb.')"/>
</xsl:attribute>
</img>
</a>
</li>
</xsl:for-each>
Hi Hutch
Looks like the code you are using are for the legacy XML schema. Try this instead:
<xsl:for-each select="umbraco.library:GetMedia(1074, 1)/Image">
<li>
<a class="image" rel="gallery">
<xsl:attribute name="href">
<xsl:value-of select="umbraco.library:GetMedia(@id, 0)/umbracoFile"/>
</xsl:attribute>
<img>
<xsl:attribute name="src">
<xsl:value-of select="umbraco.library:Replace(umbraco.library:GetMedia(@id, 0)/umbracoFile, '.', '_thumb.')"/>
</xsl:attribute>
</img>
</a>
</li>
</xsl:for-each>
Does this give you any output?
/Kim A
Yes! Success!!!! Thank you!
You are welcome Hutch!
Maybe you could consider putting this extension call:
umbraco.library:GetMedia(@id, 0)
in the for-each into a variable to save some extensions-calls. Like this:
and then you can use the $mediaNode the two places where you called the GetMedia in the for-each. Just an idea to save some extension calls.
/Kim A
You are welcome Hutch!
Maybe you could consider putting this extension call:
umbraco.library:GetMedia(@id, 0)
in the for-each into a variable to save some extensions-calls. Like this:
and then you can use the $mediaNode the two places where you called the GetMedia in the for-each. Just an idea to save some extension calls.
/Kim A
Hi Hutch,
I've created the Digibiz Advanced Media Picker. With this new media picker you can store multiple items in 1 picker which is perfect for creating a photo gallery. You can watch a very simple photo gallery sample here: http://screenr.com/TEY.
Jeroen
is working on a reply...