Copied to clipboard

Flag this post as spam?

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


  • hetaurhet 245 posts 267 karma points
    Jun 21, 2011 @ 16:17
    hetaurhet
    0

    I am new to umbraco and using umediaslider. using 4.7 version of umbraco. I made another umediaslider for my website. the xslt which I created is having same code of existing umediaslider. So, what change in that I have to do?

    also, just confirming... that to use this, I have to insert its corresponding macro into template ... right?

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jun 23, 2011 @ 19:30
    Kim Andersen
    0

    Hi hetaurhet

    Could you show us the code that you've got so far? I think this will help us help you.

    And your second question - Yes, you need to insert the macro in one of your templates to make use of your XSLT code.

    /Kim A

  • hetaurhet 245 posts 267 karma points
    Jun 24, 2011 @ 10:42
    hetaurhet
    0

    i have following umediaslider xslt code ...

    <?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" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary"
      exclude-result-prefixes="msxml  umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes  Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings  Exslt.ExsltSets tagsLib BlogLibrary ">

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <!-- start writing XSLT -->
      <xsl:variable name="sliderNode" select="$currentPage/parent::*/child::*[@level=1]"/>

     <div id="slider">
        <div id="imageSlider">
          <xsl:for-each select="$sliderNode/child::umediaSlider">
               <div class="imageSlide">
                  <div class="imageSliderInfo">
                      <h2> <xsl:value-of select="@nodeName"/></h2>
                      <xsl:value-of select="teaserText" disable-output-escaping="yes"/>
                    </div>
                    <div class="imageSliderImage">
                      <img src="{umbracoFile}" width="500" height="320" />
                    </div>
                </div>
           
          </xsl:for-each>
       </div>
    </div>
    </xsl:template>

    ... under content node I have created node AngerSlider with two sub nodes. what change in xslt I need to do... in template I have inserted macro of the above xslt.

     

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jun 24, 2011 @ 17:41
    Kim Andersen
    0

    Could you maybe show us your content tree? You probably just haveto change the xPath in the sliderNode-variable. But if You could show us your structure in the content section it would be a little easier. Just somthing like:

    - Content

    -- Home

    --- Some page

    --- Another page

    etc...

     

    /Kim A

  • hetaurhet 245 posts 267 karma points
    Jun 25, 2011 @ 06:26
    hetaurhet
    0

    - content

        -- main website node

               --- Home

               --- About us

                       ---- who we are?

        -- my img slider

    this is the structure. where my img slider is umedia slider and which I want to use in 'who we are' content page.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jun 25, 2011 @ 11:41
    Kim Andersen
    0

    Okay I guess that you've got the nodes under the "my img slider"-node?

    To get the "my img slider"-node, you should be able to do like this:

    <xsl:variable name="sliderNode" select="$currentPage/ancestor-or-self::root/*[@nodeName='my img slider']"/>

    I the above example I'm using the node name to match, but a better way would probably be to use the document type alias, if the node has a unique document type.

    /Kim A

  • hetaurhet 245 posts 267 karma points
    Jun 26, 2011 @ 10:35
    hetaurhet
    0

    Thanks Kim it works now...........

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jun 26, 2011 @ 11:04
    Kim Andersen
    0

    Great to hear! I'm glad it works now.

    /Kim A

  • Kim Andersen 1447 posts 2196 karma points MVP
    Jun 26, 2011 @ 11:48
    Kim Andersen
    0

    Ohh by the way, the xPath that worked above can of course be used all over the site. That means that you can create nodes whereever you want in the content tree and the slider should still work. If not shout out loud :)

    If you can mark one of the answers above as the solution it would be great, so that other users can see that this post is solved :)

    /Kim A

  • hetaurhet 245 posts 267 karma points
    Jun 26, 2011 @ 16:39
    hetaurhet
    0

    yes its working for any level of node

Please Sign in or register to post replies

Write your reply to:

Draft