Strange: The image is being written out and just not appearing? In IE a broken image gives a box witht he red cross, so this might well be a problem with css. If you disable your stylesheet temporarily can you see the image in IE?
Peter, thank you for your suggestion, but I have tried this without any joy.
Dan, disabling the stylesheet does not make a difference. One thing I have notices is that the URL given for the image is not the same as the actual (assuming it was a physical folder). The folder 6583 is called optima. I do not know if this is the difference.
Another thing is that this is within some jquery to make the area scroll (without scroll bar etc.). I will try removing this and see what happens.
ah, perhaphs it is the jpg itself then. I've had this behaviour with a client of mine as well. They saved the image on a Mac, somehow IE couldn't handle that. Could you try saving the jpg with some different settings?
One last question then: was the original image (the one that didn't work) created on a Mac? Not sure what causes it, but if you save it with some default setting on a Mac, IE can't display it somehow. Don't ask me why, perhaphs someone else knows the answer to that.
XSLT image not displaying in IE
I am using the following XSLT to display a single image from the Media section.
In all browsers (FireFox, Opera and Safari) it is displaying the image, but not in IE.
Any know why, and what I can do to fix this?
<xsl:choose> <xsl:when test="string(./data [@alias='latestNewsImage']) != '' "> <div> <div class="lnleft"> <p><strong><xsl:value-of select="data [@alias = 'headline']" disable-output-escaping="yes"/></strong></p> <a style="float:left" href="{umbraco.library:NiceUrl(@id)}"><img alt="left Arrow" height="8px" width="4px" src="../../aawen/main/images/leftarrow.jpg" /> read more ...</a> </div> <div class="lnright"> <img style="float:right"> <xsl:attribute name="src"> <xsl:value-of select="umbraco.library:GetMedia(./data [@alias='latestNewsImage'], 'false')/data [@alias='umbracoFile']" /> </xsl:attribute> </img> </div> </div> </xsl:when> <xsl:otherwise>
Thanking in advance.
Hi There
I don't see anything obviously wrong with your xsl (although you may want to use absolute paths for images). What is the resulting html code?
Cheers,
Dan
Hi,
What is your <xsl:output /> method set to? If it's HTML, then the <img> tag might cause problems in IE, e.g.
Try changing the method to XML:
So that it outputs as:
Good luck, Lee.
Lee thank you for your reply the xml output is:
<xsl:output method="xml" omit-xml-declaration="yes"/>
Dan thank you for your help and the resulting HTML is:
<div class="lnright"><img style="float:right" src="/media/6583/optimaicon4col.jpg" /></div>
I hope this helps, and I am glad to hear that the XSLT looks alright (so far).
Strange: The image is being written out and just not appearing? In IE a broken image gives a box witht he red cross, so this might well be a problem with css. If you disable your stylesheet temporarily can you see the image in IE?
Can it be a caching issue in IE? Try disabling caching (if you haven't allready)
Peter, thank you for your suggestion, but I have tried this without any joy.
Dan, disabling the stylesheet does not make a difference. One thing I have notices is that the URL given for the image is not the same as the actual (assuming it was a physical folder). The folder 6583 is called optima. I do not know if this is the difference.
Another thing is that this is within some jquery to make the area scroll (without scroll bar etc.). I will try removing this and see what happens.
Thanks again for your help.
And just now you tell us you use jquery ;-)
Try opening the full URL to the image in IE. The image should show just fine. If it does, it's probably something in jquery messing up in IE.
If the image doesn't show in IE, there's something else wrong. Try checking the media-folder to see if the image is actually there.
HTH,
Peter
Peter thank you for getting back to me. It is not the jquery (disabled this).
I used the URL to the image in the browser and it works (e.g. shows the image) in Opera, Safari (on PC and Mac) and FireFox, but not in IE.
The image is a jpg, so I do not know why this would appear in all browsers apart from 1.
I will now try changing the image and see if this helps.
Thanks once again for your help.
ah, perhaphs it is the jpg itself then. I've had this behaviour with a client of mine as well. They saved the image on a Mac, somehow IE couldn't handle that. Could you try saving the jpg with some different settings?
Peter many thanks.
It was something to do with the image/folder.
I have replaced this and all is now working.
Now the question is why did this just affect IE?
Thanks everyone for your help.
This was the same, with the client machine being a Mac.
Is this wide spread?
I am asking because they are going to be uploading a number of files, and they are a Mac only business.
One last question then: was the original image (the one that didn't work) created on a Mac? Not sure what causes it, but if you save it with some default setting on a Mac, IE can't display it somehow. Don't ask me why, perhaphs someone else knows the answer to that.
Peter, yes the image was created and saved on a Mac (using Photoshop CS4).
All I did was to re-save the file and it worked (on a Windows machine (using GIMP)).
is working on a reply...