I seem to have smashed my head quite a few times against the wall now, and i simply can't figure out what it is that i'm doing wrong. I'm new to Xslt - so bear with me! :)
The idea:
I'm trying to create a dynamic image gallery by having a "master-gallery" template. This template is supposed to have a macro, that takes all the childpages data, and turns them into a gallery for each childpage. Like this more or less:
Master Gallery (where all the galleries are displayed with 1 image) - January - February - And so on..
The child pages simply has a media picker, which picks the folder the user wants to load all the images from, and with the macro i then add a shadowbox to each link, whilst also using imagegen for thumbnails.
The problem:
While i'm able to get the galleries on the master-gallery page, the media picker ID doesn't change. It seems as if it doesn't change, or isn't working as a "for-each" and then only loads the id of the first childpage. Each of the childpages i've tested with of course has a different folder selected with the media picker, but it doesn't quite seem to work.
The way you define them right now, they'll always get the same value (taken from the first descendant of $currentPage, actually).
Inside a for-each the context node will be set for you, so the gallerimap, thumbbredde and thumbhjde will be taken from the current node being processed.
Dynamic image-gallery from data of child pages.
Greetings everyone!
I seem to have smashed my head quite a few times against the wall now, and i simply can't figure out what it is that i'm doing wrong. I'm new to Xslt - so bear with me! :)
The idea:
I'm trying to create a dynamic image gallery by having a "master-gallery" template. This template is supposed to have a macro, that takes all the childpages data, and turns them into a gallery for each childpage. Like this more or less:
Master Gallery (where all the galleries are displayed with 1 image)
- January
- February
- And so on..
The child pages simply has a media picker, which picks the folder the user wants to load all the images from, and with the macro i then add a shadowbox to each link, whilst also using imagegen for thumbnails.
The problem:
While i'm able to get the galleries on the master-gallery page, the media picker ID doesn't change. It seems as if it doesn't change, or isn't working as a "for-each" and then only loads the id of the first childpage. Each of the childpages i've tested with of course has a different folder selected with the media picker, but it doesn't quite seem to work.
The Xslt:
Thanks for reading, i hope you can help. :)
// Thomas
Can't edit my post for some reason; but i use Umbraco 4.7.0 by the way. :)
// Thomas
Hi Thomas,
If I understand you correct, you should just change the three variables to this:
The way you define them right now, they'll always get the same value (taken from the first descendant of $currentPage, actually).
Inside a for-each the context node will be set for you, so the gallerimap, thumbbredde and thumbhjde will be taken from the current node being processed.
/Chriztian
Hi Chriztian,
Thanks a lot! That worked spot on. :)
Virtual high-five for you my friend, truly appreciated with the swift help!
I'd high five you if i could!
Have a nice day!
// Thomas
is working on a reply...