Copied to clipboard

Flag this post as spam?

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


  • Matt 20 posts 40 karma points
    Feb 26, 2013 @ 21:38
    Matt
    0

    XSLT Query !!!

    Hi all,

     

    Using the following XSLT as a macro e.t.c (it is a basic image slider)

    No errors but it doesnt show images just the red x (no image) type thingy...

    I have a slideshow and slide under the root... stratching my head a plenty.. any tips appreciated ....

     

    XSLT:

    <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>

    <xsl:stylesheet 

      version="1.0" 

      xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 

      xmlns:msxml="urn:schemas-microsoft-com:xslt"

      xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" 

      exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets ">

    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

      <xsl:template match="/">

        <xsl:variable name="nodeIds" select="umbraco.library:Split($currentPage/slideshow,',')" />

        <div id="slideshow">

          <ul>

            <xsl:for-each select="$nodeIds/value">

              <li class="rotating-panel fc">

                <xsl:if test="position() > 1">

                  <xsl:attribute name="style">display:none;</xsl:attribute>

                </xsl:if>

                <xsl:variable name="slide" select="umbraco.library:GetXmlNodeById(current()/.)"/>

                <img class="fl" alt="{$slide/@nodeName}" src="{$slide/mainImage}"/>

                <div class="">

                  <xsl:value-of select="$slide/bodyText" disable-output-escaping="yes"/>

                </div>

              </li>

            </xsl:for-each>

          </ul>

          <ul id="slidePager">

            <xsl:for-each select="$nodeIds/value">

              <li>

                <a href="?position={position()}">

                  <xsl:if test="position() = 1">

                    <xsl:attribute name="class">selected</xsl:attribute>

                  </xsl:if>

                  <xsl:value-of select="position()"/>

                </a>

              </li>

            </xsl:for-each>

          </ul>

        </div>

      </xsl:template>

    </xsl:stylesheet>

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 26, 2013 @ 22:21
    Jan Skovgaard
    0

    Hi Matt

    What does the rendered image path look like?

    And have you checked that the media nodes have been mapped to an image file?

    /Jan

  • Matt 20 posts 40 karma points
    Feb 27, 2013 @ 13:00
    Matt
    0

    Hi ,

    Thanks for the reply Jan.

    It shows the img tag as completely empty in the renderd html.

    I have a folder of doc type slideshow and within that a doctype of slide which has an image mapped to it.

    Very confused. Any further advise appreciated. You can see the image display prob at http://www.refreshme.org.uk

     

    Thanks

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 27, 2013 @ 21:03
    Jan Skovgaard
    0

    Hi Matt

    What XML do you get returned if you write this?

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

    Looking forward to hearing from you.

    /Jan

  • Matt 20 posts 40 karma points
    Feb 27, 2013 @ 21:17
    Matt
    0

    Thank you once again.

    Do you mean for me to add that to the page that tries to embed the macro e.t.c

     

    Cheers

  • Matt 20 posts 40 karma points
    Feb 27, 2013 @ 21:21
    Matt
    0

    I tried adding the code to the html of the homepage but it displays as empty.... no errors

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 27, 2013 @ 21:30
    Jan Skovgaard
    0

    Hi Matt

    I mean you should add the above snippet in the macro you're trying to get to render the image.

    Seems like you're not getting any data returned...

    Do you get any id's by simply writing <xsl:value-of select="$currentPage/slideshow" /> ?

    If not what is the context of the page you're currently on? How does it know what image to display?

    /Jan

  • Rich Green 2246 posts 4008 karma points
    Feb 27, 2013 @ 21:55
    Rich Green
    0

    Hey Matt,

    What value does "slideshow" have in your /App_Data/umbraco.config have?

    If you're using the MultiNodeTreePicker then this has CSV or XML settings, your code needs CSV

    Rich

  • Rich Green 2246 posts 4008 karma points
    Feb 27, 2013 @ 21:56
    Rich Green
    0

    Actually Matt, your logic is a little wrong here, where did you get that XSLT from?

    You need (in XSLT or Razor) to traverse to the SlideShow node and then loop through the child fields.

    Make sense?

    Rich

  • Matt 20 posts 40 karma points
    Mar 03, 2013 @ 13:31
    Matt
    0

    Hi, Thanks for replies and sorry for my late reply (got the man flu)

    Anyway it is the xslt taken from the Basic Website StarterKit by Chris Koiak.

    From what I can see I have it set up in my site exactly as it appears to be in his site but no joy...

    Could you elaborate a little on what you mean by traverse to the slideshow then loop through child fields e.t.c

    Appreciate all your help.. I am such a noob but starting to get to grips with it now a bit lol

  • Matt 20 posts 40 karma points
    Mar 04, 2013 @ 19:06
    Matt
    0

    Any hints appreciated !

     

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft