I'm creating a gallery where I need to check the dimensions of the images from the mediafolder against each other, and then pass the value to ImageGen to generate the correct thumb sizes. The images will then be cropped (using jQuery) to make them look nice in the gallery.
My solution will only work if I can pass the correct string to ImageGen based on the dimensions.
After reading more about variables in XSLT, I've learned that it's not possible to change the value once it has been defined. Is it possible to do as I'm trying, or is there a clever solution to the problem?
Thank you (again) so much! That works like a charm :-) One can really learn from this forum!
Btw, I have a strange problem when fetching the images for the gallery. The first entry generates a "Hello World" image with ImageGen, because it cannot find the specific file.
It looks like there's an existing media item in the media library (with id="1208") but it has no file uploaded. Try to go to the media section of the backoffice and upload an image to this entry again. (If everything is ok there'll be some path like /media/bla-bla-bla inside <umbracoFile> tag after this - currently you can see that it's empty)
Change the value of a variable
Hi.
I'm creating a gallery where I need to check the dimensions of the images from the mediafolder against each other, and then pass the value to ImageGen to generate the correct thumb sizes. The images will then be cropped (using jQuery) to make them look nice in the gallery.
My solution will only work if I can pass the correct string to ImageGen based on the dimensions.
Here's my approach:
When the variables have been defined, I want to insert the value of the one variable in the string that generates the new image with ImageGen.
After reading more about variables in XSLT, I've learned that it's not possible to change the value once it has been defined. Is it possible to do as I'm trying, or is there a clever solution to the problem?
Thanks in advance for your help!
Stefan.
Hi Stefan,
You can "open" the variable declaration and use choose/when/otherwise to determine the result:
/Chriztian
What if try this:
(I didn't try it on my own, however - not sure it will work)
Thank you (again) so much! That works like a charm :-)
One can really learn from this forum!
Btw, I have a strange problem when fetching the images for the gallery.
The first entry generates a "Hello World" image with ImageGen,
because it cannot find the specific file.
Look at this output:
I had trouble with a image not showing correctly, I then deleted it.
It's like it's still there in the cache or something.
I have already refreshed the XML cache, but that didn't do the trick.
Any clues?
It looks like there's an existing media item in the media library (with id="1208") but it has no file uploaded. Try to go to the media section of the backoffice and upload an image to this entry again. (If everything is ok there'll be some path like /media/bla-bla-bla inside <umbracoFile> tag after this - currently you can see that it's empty)
Thank you. That did the trick!
is working on a reply...