The xslt displays the header image dynamically. If the current page doesn't have an image selected (media picker), it uses the closes parent that has one. There are two versions of the image, one with a height of 200px and one with a height of 100px. So the parent has the 200 px image selected and the property check that states that the height should be set accordingly. The child page needs to use the parent page's image, but needs the small version. The filenames are as such: image-sm.jpg and image-lg.jpg. I was thinking I could do this by just replacing the sm.jpg or lg.jpg with the appropriate ending, but the folder is different.
What is a good way to dynamically switch out the image as mentioned above?
How are the images connected? Do you have two Upload properties on the Images Media Type, or how is it done? Which image does the media picker point to if they're separate media items?
Have you DAMP package? Looks like that would be a great fit for this, as you can upload a single image and define 2 (or more) crops, which are stored alongside each other, and you can easily pick the one you need.
Retrieve Associated Image/Media
Here's the situation:
The xslt displays the header image dynamically. If the current page doesn't have an image selected (media picker), it uses the closes parent that has one. There are two versions of the image, one with a height of 200px and one with a height of 100px. So the parent has the 200 px image selected and the property check that states that the height should be set accordingly. The child page needs to use the parent page's image, but needs the small version. The filenames are as such: image-sm.jpg and image-lg.jpg. I was thinking I could do this by just replacing the sm.jpg or lg.jpg with the appropriate ending, but the folder is different.
What is a good way to dynamically switch out the image as mentioned above?
Hi Stephanie,
How are the images connected? Do you have two Upload properties on the Images Media Type, or how is it done? Which image does the media picker point to if they're separate media items?
Have you DAMP package? Looks like that would be a great fit for this, as you can upload a single image and define 2 (or more) crops, which are stored alongside each other, and you can easily pick the one you need.
/Chriztian
is working on a reply...