Copied to clipboard

Flag this post as spam?

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


  • Elad Lachmi 112 posts 144 karma points
    Mar 09, 2011 @ 04:23
    Elad Lachmi
    0

    get node properties

    Hi,

    I'm new to Umbraco and I don't even know if I'm going about this the right way.

    I want to populate a jquery slider via xslt. For each slide I need HTML text (with headings etc.) and a background image for the slide.

    What I was thinking is to create a node for each slide with a rich text editor for the HTML and a media picker for the background image and then get these properties via xslt and create a div from each one.

    Would this actually be the way to go about this? Lets say the nodes are of a DocType "slider", how would I go about iterating through only this doctype and accessing the two properties of the doctype via xslt?

    Thank you in advance!

    -Elad

  • Lee 1130 posts 3088 karma points
    Mar 09, 2011 @ 07:13
    Lee
    0

    Example of looping through 'Slider' doctypes from the currentpage, as in your 'slider' doctypes would be below the currentpage

                <xsl:for-each select="$currentPage//slider [@isDoc]">

                      <div>
                        <p><xsl:value-of select="./APropertyOnYourSlider" /></p>                    
                      </div>

                </xsl:for-each>
  • Elad Lachmi 112 posts 144 karma points
    Mar 09, 2011 @ 07:32
    Elad Lachmi
    0

    Thank you. That works.

    My only issue is that the field is richtexteditor.

    I need to get it coded as HTML and not as text. Right now I get <p>bla bla bla</p>.

    One last thing, in xsl can I add tags inline within HTML strings or do I need to use + or something similar?

  • Lee 1130 posts 3088 karma points
    Mar 09, 2011 @ 07:47
    Lee
    0

    Quite simple change it to the following.. Adding disable-output-escaping="yes"

     

    <xsl:value-of select="./APropertyOnYourSlider" disable-output-escaping="yes" />

     

Please Sign in or register to post replies

Write your reply to:

Draft