I am trying to insert a rollback image in this list if there is no image present in the content section (I select an image via the media picker).
I have tried all sorts of combos but I really need some proper help from someone who understands what each bit of the code does. I have so far worked out that moving the variables outside of the <xsl:choose> does not render the list properly, and theat <xsl:when> cannot be a child of <xsl:when> etc etc..anyway, that's propbably very basic to you guys. I have adapted this from the runway news xslt so credit to Kim Løwert :)
Thanks if anyone can shed some light on this. I just don't know in which order to put this stuff. I imagine it's all over the place! On a plus note, it works perfectly when useing <xsl:if> statements rather than choose, whens and otherwise...
Perhaps there is a better way? Or maybe I'm on the right track, not sure :(
Render a list image otherwise rollback image
Hi everyone, I know my xslt is pretty lame still but I am trying!
I am trying to insert a rollback image in this list if there is no image present in the content section (I select an image via the media picker).
I have tried all sorts of combos but I really need some proper help from someone who understands what each bit of the code does. I have so far worked out that moving the variables outside of the <xsl:choose> does not render the list properly, and theat <xsl:when> cannot be a child of <xsl:when> etc etc..anyway, that's propbably very basic to you guys. I have adapted this from the runway news xslt so credit to Kim Løwert :)
Thanks if anyone can shed some light on this. I just don't know in which order to put this stuff. I imagine it's all over the place! On a plus note, it works perfectly when useing <xsl:if> statements rather than choose, whens and otherwise...
Perhaps there is a better way? Or maybe I'm on the right track, not sure :(
Regards,
Sam.
Hey Sam,
Does the above code all work when you have an image?
If so then you just need to add a choose statement to show when there is no image
paste this in to replace
Your code could be cleaned up a bit as you don't need to assign the media variable twice (once to focusImage and then again to mediaid)
Your logic is a little out of place for when the image is blank, got to run, if I get more time I'll post a further explantion.
hth
Rich
Thanks Rich,
Yeah works ok with an image (picked in the content area), then just displays nothing when no image present.
I'm just not sure how to clean it up, will persevere and post back :)
Sam.
This works perfectly :) not sure if it's 'cleaned up' enough.
Thanks again Rich.
Sam.
is working on a reply...