I'm a complete beginner on Xslt and i'm hitting a brick wall, I wondered if somebody could point me in the right direction in getting all images contained in an Umbraco folder (ID 1079) and displaying them in a carousel that I have already put to use on the site. At the moment I have the carousel as a div and have listed all the images seperately within that to get the carousel to work. But i'd now like the option of it automatically pulling the images from the folder and using them.
You're spot on, that works great. I can't thank you enough!
It's displaying each photo now in the carousel as I add them, I just wondered though (and I'm taking advantage of your knowledge now) ... how would I set these so that when the user clicks on the photo it takes them to a page or link... as before adding the xslt I was using <a href> ...
Well, great that you've already found your solution. Just want to come up with my inputs anyway :)
You could either expand the image-media type with a field for the link, and then just use that link on the image.
A whole other way could be to create the banner in the content section, using some media pickers and some content pickers to define which images and links should be shown in the banner.
But if you found your solution everything is good right :)
Images from Umbraco folder straight to Carousel
Hi,
I'm a complete beginner on Xslt and i'm hitting a brick wall, I wondered if somebody could point me in the right direction in getting all images contained in an Umbraco folder (ID 1079) and displaying them in a carousel that I have already put to use on the site. At the moment I have the carousel as a div and have listed all the images seperately within that to get the carousel to work. But i'd now like the option of it automatically pulling the images from the folder and using them.
Thanks for any help!
Hi Monkey
I'm not sure I can remember the XML schema for the media-section, but I think something like this will work for you:
If im correct, the for-each loop will run through the images in the sepcified folder, and list all of the images in that folder.
But as said, I'm not 100% sure that the code will work out of the box, maybe you have to do some small changes to it.
/Kim A
Hi Kim,
You're spot on, that works great. I can't thank you enough!
It's displaying each photo now in the carousel as I add them, I just wondered though (and I'm taking advantage of your knowledge now) ... how would I set these so that when the user clicks on the photo it takes them to a page or link... as before adding the xslt I was using <a href> ...
Thanks again!
Cool, grea to hear.
You can just put a link inside the for-each loop like this:
This will, however, give you the same link on all of the images. Don't know if you want this.
Or do you need to have a unique link on each image?
/Kim A
Yeah unfortunately it will be a unique link on each image, and ideally this would be something the user could set...?
Thanks!
Hi again,
I managed to solve this by creating a different type of image in Umbraco and linking to that. Thanks so much for your help!
Hi again
Well, great that you've already found your solution. Just want to come up with my inputs anyway :)
You could either expand the image-media type with a field for the link, and then just use that link on the image.
A whole other way could be to create the banner in the content section, using some media pickers and some content pickers to define which images and links should be shown in the banner.
But if you found your solution everything is good right :)
/Kim A
can u give me the whole code i need to incorporate the same..very urgent
is working on a reply...