The tricky part to this one is that the macro parameter is a "mediaCurrent" — that one holds an ID when you look at thetag but inside the XSLT it's actually the XML for (in this case) the Folder - but not its contents...
And a standard Media Picker only stores the id, so... you need different approaches depending on if you're using a macro parameter or a picker on $currentPage.
I almost got it working though!.. in the template Image here i made some modifications where i need to display only the first image but still have the other images sitting in the html to make a slideshow.
I tried this but didnt get me working instead, is there a way of pulling the croped thumbnails image instead of the {umbracoFile} ?
You do not need to test for position() inside the Image folder - if you're using my example the "album" mode template selects the first Image in the apply-templates.
Make sense but i need to display all the images withing the folder, that is when clicking on the first one i should be able to slide through the others.
Have you got a prototype of ythe *final* HTML you want to render? That's so crucial to getting things right and finding out which templates you need etc.
Getting Images with media Folder
Hi All,
I kind of lost at the moment from what seems to be simple to do in razor but just cant get it working in xslt.
I have a xslt macro using parameter mediaCurrent where i have the following structure in my media
Gallery 1
album 1
album 2
album 3
We need to display each album name and whithin it display the first image. Something like
Album 1 Album 2 Album 3
img 1 img1 img 1
am not sure of how to get it working after displaying the folder (album 1-3) here
Any help on this ?
Hi Fuji,
Something like this should work (haven't tested it though):
/Thor
Hi Thor,
Nope didnt get it to work it just give me an error.
Hi Fuji,
Here's a match template approach to do it - separate templates for all the bits so you have a clear idea which does what:
/Chriztian
Aij... hadn't seen your post, Thor -
The tricky part to this one is that the macro parameter is a "mediaCurrent" — that one holds an ID when you look at thetag but inside the XSLT it's actually the XML for (in this case) the Folder - but not its contents...
And a standard Media Picker only stores the id, so... you need different approaches depending on if you're using a macro parameter or a picker on $currentPage.
/Chriztian
Thanks for this Chriztian,
I almost got it working though!.. in the template Image here i made some modifications where i need to display only the first image but still have the other images sitting in the html to make a slideshow.
I tried this but didnt get me working instead, is there a way of pulling the croped thumbnails image instead of the {umbracoFile} ?
Is it possible to concat the img ?
Hi Fuji,
You do not need to test for position() inside the Image folder - if you're using my example the "album" mode template selects the first Image in the apply-templates.
To get the thumbnail, do this:
(Thumbnails are always JPG)
/Chriztian
Make sense but i need to display all the images withing the folder, that is when clicking on the first one i should be able to slide through the others.
Here am getting the Folder Name to get all images for the slideshow to work but since templates select="Image[1]" no slideshow will be trigger
Hi Fuji,
Have you got a prototype of ythe *final* HTML you want to render? That's so crucial to getting things right and finding out which templates you need etc.
/Chriztian
From the xslt you sent how do i get to Truncate some text, this aint working anymore
Hi Fuji,
I trust you to be able to find that :-)
/Chriztian
Make sense, so whatever value with umbraco.library will now use umb ?
is working on a reply...