Are you sure that the image is not hidden by some kind of CSS or stuff like that. Could you check whether the img-tag is rendered in the source of the page. Even it's not vissible on the frontend.
I have to say that it sounds very weird, when it appears sometimes and sometime it doesn't.
Images doesn't show properly
Hi,
I have an xslt like following one, the first image always show, but the second image doesn't show sometimes.
What could be the reason?
Thanks.
<xsl:variable name="spot1" select="umbraco.library:GetXmlNodeById(string($currentPage/spot1))"/>
<xsl:if test="$spot1/introducerPicture">
<xsl:variable name="media" select="umbraco.library:GetMedia($spot1/introducerPicture, 0)" />
<xsl:if test="$media">
<img src="{$media/umbracoFile}" alt="{$media/altText}" width="248" height="90" />
</xsl:if>
</xsl:if>
<xsl:variable name="spot2" select="umbraco.library:GetXmlNodeById(string($currentPage/spot2))"/>
<xsl:if test="$spot2/introducerPicture">
<xsl:variable name="media" select="umbraco.library:GetMedia($spot2/introducerPicture, 0)" />
<xsl:if test="$media">
<img src="{$media/umbracoFile}" alt="{$media/altText}" width="248" height="90" />
</xsl:if>
</xsl:if>
Hi!
Are you sure that the spot2 on the current page has a selected node from a content picker or is is a textstring with a valid node id in it?
Maybe you could try republishing the current page and the node where the introducePicture is stored on.
/Kim A
Yes, I am sure that it is selected from a content picker.
I tried publishing currentpage and the node where the introducerPicture again and again. I also published whole content again, but no chance.
It sometimes shows, but generally not shown.
Thanks.
Okay then. Could you try printing out the $spot2 like this:
Then we can see what the variable contains.
/Kim A
It is like this, it has an introducerPicture value.
<umbTextpage id="1133" parentID="1131" level="3" writerID="0" creatorID="0" nodeType="1061" template="1054" sortOrder="1" createDate="2011-02-17T17:19:40"
updateDate="2011-03-09T16:09:56" nodeName="a nodeName" urlName="a urlName" writerName="admin"
creatorName="admin" path="-1,1063,1131,1133" isDoc="">
<summary>
a summary
</summary>
<introducerPicture>1328</introducerPicture>
<bodyText>
a bodyText
</bodyText>
<umbracoNaviHide>1</umbracoNaviHide>
</umbTextpage>
And you're sure that there's a media node with an id of 1328 (just have to make sure, so we're going through the debugging step-by-step).
Could you try to do the textarea-trick with the $media.
/Kim A
Yes, there is a media item with an id of 1328.
It appeared once again, and it disappeared after another refresh.
Are you sure that the image is not hidden by some kind of CSS or stuff like that. Could you check whether the img-tag is rendered in the source of the page. Even it's not vissible on the frontend.
I have to say that it sounds very weird, when it appears sometimes and sometime it doesn't.
/Kim A
Yes, I am sure that the image is not rendered and I cannot see it in the html source code.
I am pulling my hair, because of this :(
I noticed that the first image is type of File and the others are type of Image.
type of File and type of Image both have umbracoFile property, but type of Image do not work for umbraco.library:GetMedia method.
What can be the reason? Are there any umbraco core specific things?
is working on a reply...