Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Stephanie 39 posts 101 karma points
    Nov 11, 2011 @ 16:55
    Stephanie
    0

    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?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Nov 11, 2011 @ 23:23
    Chriztian Steinmeier
    0

    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

Please Sign in or register to post replies

Write your reply to:

Draft