Copied to clipboard

Flag this post as spam?

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


  • Seyfullah Tıkıç 23 posts 43 karma points
    Mar 09, 2011 @ 14:42
    Seyfullah Tıkıç
    0

    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>

  • Kim Andersen 1447 posts 2196 karma points MVP
    Mar 09, 2011 @ 14:48
    Kim Andersen
    0

    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

  • Seyfullah Tıkıç 23 posts 43 karma points
    Mar 09, 2011 @ 14:58
    Seyfullah Tıkıç
    0

    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.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Mar 09, 2011 @ 15:11
    Kim Andersen
    0

    Okay then. Could you try printing out the $spot2 like this:

    <textarea>
    <xsl:copy-of select="$spot2" />
    </textarea>

    Then we can see what the variable contains.

    /Kim A

  • Seyfullah Tıkıç 23 posts 43 karma points
    Mar 09, 2011 @ 15:20
    Seyfullah Tıkıç
    0

    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>

  • Kim Andersen 1447 posts 2196 karma points MVP
    Mar 09, 2011 @ 15:30
    Kim Andersen
    0

    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

  • Seyfullah Tıkıç 23 posts 43 karma points
    Mar 09, 2011 @ 15:41
    Seyfullah Tıkıç
    0

    Yes, there is a media item with an id of 1328.

    It appeared once again, and it disappeared after another refresh.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Mar 09, 2011 @ 15:44
    Kim Andersen
    0

    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

  • Seyfullah Tıkıç 23 posts 43 karma points
    Mar 09, 2011 @ 16:11
    Seyfullah Tıkıç
    0

    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 :(

  • Seyfullah Tıkıç 23 posts 43 karma points
    Mar 10, 2011 @ 13:52
    Seyfullah Tıkıç
    0

    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?

Please Sign in or register to post replies

Write your reply to:

Draft