Copied to clipboard

Flag this post as spam?

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


  • David 57 posts 80 karma points
    Jun 13, 2011 @ 17:09
    David
    0

    Images not displaying

    Original thread is marked solved, but still have issues, bringing this to a new post, in hopes it gets viewed. 

    Its easy enough to get around the System.OverflowException with the "ignore errors" checkbox.  However, I cannot get images to show even with the above modifications.   The following change produces no images. 

     class="items">
             
     select="$imageFolderContents/Image">

     

    If I throw this <xsl:value-of select="$imageFolderContents"/> into the "main_gallery_title" I get the following.

    /media/2974354/55555_102.gifgif113312/media/2974357/55555_129.gifgif69288/media/2974360/55555_130.gifgif108396/media/2974363/55555_157.gifgif102921

     

    What am I missing?  I know its something simple that its stupid.  The images are obviously being found, but not displayed. I've tried various things in the for-each to produce the image to no avail.

    Thanks

  • Jan Skovgaard 11257 posts 23497 karma points MVP 7x admin c-trib
    Jun 13, 2011 @ 18:58
    Jan Skovgaard
    0

    Hi David

    Rather than starting a new post then I personally think it's better to "bump" in on the old one, since your question is related to an already existing question.

    But for now I'll reply in here :-)

    Since you're using 4.7 you can't trust the XML structure to be the same, since there was a small bug with that in v 4.5.2, which was the version the original poster had issues with.

    Therefore try creating a <textarea></textarea> where you make a xsl:copy-of, which will return the XML you're trying to match.

    Like this

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

    I'm guessing you need to write it like $imageFolderContents/Folder/Image...but try to see what you get returned.

    Hope this helps.

    /Jan

  • David 57 posts 80 karma points
    Jun 13, 2011 @ 21:37
    David
    0

    I am not a fan of creating a whole new post either.  Since the other topic had a "solution", it appeared no one was answering or viewing additions.  Your suggestion worked perfectly to find the exact XML output I needed.  I had tried that earlier, but apparently didn't have the right path to produce the output. 

    Greatly appreciated.  

    For those who struggle with this the output I got for the XML

    From this

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

    was

    <Folder ...bunch of attributes>
    <File ...bunch of attributes>
    <umbracoFile>"path to file"</umbracoFile>
    <umbracoExtension>"extension"</umbracoExtension>
    <umbracoBytes>"byte size"</umbracoBytes>
    </File>
    </Folder>

    Hopefully that saves someone the headache I encountered.

  • David 57 posts 80 karma points
    Jun 13, 2011 @ 22:10
    David
    0

    Spoke too soon.  I got the image to display doing the following (notice the commented out textarea per your suggestion)

    Still I only get 1 image to display instead of all 4.  XML output showed all 4. Ideas??


            <ul class="items">
              <xsl:for-each select="$imageFolderContents">
                
                <xsl:if test="string(current()/File/umbracoFile) != ''">
                  <li>
                    <a>
                      <xsl:attribute name="href">
                        <xsl:text>/umbraco/ImageGen.ashx?image=xsl:text>
                        <xsl:value-of select="File/umbracoFile" />
                        <xsl:text>&height=400&compression=100xsl:text>
                      xsl:attribute>
                      <img alt="{current()/@nodeName}">
                        <xsl:attribute name="src">
                          <xsl:text>/umbraco/ImageGen.ashx?image=xsl:text>
                          <xsl:value-of select="File/umbracoFile" />
                          <xsl:text>&height=80&compression=100xsl:text>
                        xsl:attribute>
                      img>
                    a>
                  li>
                xsl:if>
              xsl:for-each>
            ul>
  • David 57 posts 80 karma points
    Jun 13, 2011 @ 22:24
    David
    0

    Alright, how do you mark your own post as a solution. :-)

    Changed the above from

    <xsl:for-each select="$imageFolderContents">

    to

    <xsl:for-each select="$imageFolderContents/File">


    Magically it all works.  Easiest is sometimes the hardest, but I hope this helps someone out.

Please Sign in or register to post replies

Write your reply to:

Draft