Copied to clipboard

Flag this post as spam?

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


  • Niklas Hjelm 104 posts 125 karma points
    Dec 31, 2010 @ 13:06
    Niklas Hjelm
    0

    Using Ultimate picker for related content with Umbraco 4.5

    Hi!

    I've been using Lee Kelleher's example for some time with the old schema but can't get it to work using 4.5. I've tried updating the script using the XSLT updater but I'm can't seem to get any values to show. I can get the related pages to show in the ultimate picker but I can't get the data to show. Any ideas?

     

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

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <xsl:variable name="preNodes">
    <xsl:variable name="relatedContent" select="$currentPage/puffPicker" />
    <xsl:variable name="nodeIds" select="umbraco.library:Split($relatedContent, ',')" />
    <xsl:for-each select="$nodeIds/value">
    <xsl:copy-of select="umbraco.library:GetXmlNodeById(.)"/>
    </xsl:for-each>
    </xsl:variable>
    <xsl:variable name="nodes" select="msxml:node-set($preNodes)/node" />

    <xsl:if test="count($nodes) > 0">

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

    <xsl:value-of select="test"/>

    </xsl:for-each>

    </xsl:if>

    </xsl:template>

    </xsl:stylesheet>

  • Johan Roug 97 posts 153 karma points
    Dec 31, 2010 @ 14:00
    Johan Roug
    0


     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 31, 2010 @ 14:21
    Jan Skovgaard
    0

    Hi Niklas

    I think you need to alter this line <xsl:for-each select="$nodeIds/value"> to use double // like this <xsl:for-each select="$nodeIds//value">, or maybe just write <xsl:for-each select="$nodeIds/values/value">

    Hope this helps.

    /Jan

  • Niklas Hjelm 104 posts 125 karma points
    Dec 31, 2010 @ 15:40
    Niklas Hjelm
    0

    Hi Jan

    Thanks for your reply. Tried it both ways but nothing happened I'm afraid. Is there anything else you can think of?

    / Niklas

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Dec 31, 2010 @ 15:50
    Jan Skovgaard
    0

    Hi Niklas

    Hmm, what does the returned XML from $relatedContent look like?

    try writing this and see what XML gets returned

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

    /Jan

  • Niklas Hjelm 104 posts 125 karma points
    Dec 31, 2010 @ 17:41
    Niklas Hjelm
    0

    Hi Jan

    It now looks lite this

     

    <xsl:variable name="preNodes">
    <xsl:variable name="relatedContent" select="$currentPage/puffPicker" />
    <xsl:variable name="nodeIds" select="umbraco.library:Split($relatedContent, ',')" />
    <xsl:for-each select="$nodeIds//value">
     
    <textarea>
    <xsl:copy-of select="$relatedContent" />
    </textarea>
      
    <xsl:copy-of select="umbraco.library:GetXmlNodeById(.)"/>

    </xsl:for-each>
    </xsl:variable>
     

    But it still returns nothing :(

  • Rich Green 2246 posts 4008 karma points
    Dec 31, 2010 @ 18:05
    Rich Green
    0

    Niklas,

    I think Jan was asking to see the output generated from the xslt above, what actually gets rendered to the page when you load the webpage?

    If the above doesn't return anything then your property alias is incorrect or your content picker hasn't saved.

    Rich

  • Niklas Hjelm 104 posts 125 karma points
    Dec 31, 2010 @ 18:14
    Niklas Hjelm
    0

    Hi Rich

    I'm not getting any data from the xslt. The output is blank. Is there any way to check if my content picker has saved?

    / Niklas

  • Niklas Hjelm 104 posts 125 karma points
    Jan 01, 2011 @ 10:52
    Niklas Hjelm
    1

    Asked Lee for help and he gave me this nifty solution.

     

    <xsl:variable name="relatedContent" select="$currentPage/RelatedContent" />

    <xsl:variable name="nodes" select="msxml:node-set($preNodes)/*[@isDoc]" />

    If you change this everything works just fine :)

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jan 01, 2011 @ 11:11
    Lee Kelleher
    0

    Glad I could help. Just for reference, a link to my blog comments.

    Cheers, Lee.

  • Md Johirul Islam 37 posts 57 karma points
    Sep 26, 2012 @ 17:52
    Md Johirul Islam
    0

    Hi every one i have ultimate picker name (selected bebefits and the alise name selectTheBenefits it hold the data) but in reply i did not get nothing. The code are below. I user the this link code (http://leekelleher.com/2009/09/08/umbraco-ultimate-picker-xslt-example/#comment-619)

    System.Xml.XmlException: The 'xsl:stylesheet' start tag on line 3 position 2 does not match the end tag of 'xsl:output'. Line 37, position 15. 
    at System.Xml.XmlTextReaderImpl.Throw(Exception e) 
    at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args) 
    at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag) 
    at System.Xml.XmlTextReaderImpl.ParseEndElement() 
    at System.Xml.XmlTextReaderImpl.ParseElementContent() 
    at System.Xml.XmlTextReaderImpl.Read() 
    at System.Xml.Xsl.Xslt.XsltInput.ReadNextSibling() 
    at System.Xml.Xsl.Xslt.XsltInput.MoveToNextSibling() 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadInstructions(List`1 content, InstructionFlags flags) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadContent(Boolean hasSelect) 
    at System.Xml.Xsl.Xslt.XsltLoader.XslVarPar() 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadGlobalVariableOrParameter(NsDecl stylesheetNsList, XslNodeType nodeType) 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadRealStylesheet() 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadDocument() 
    at System.Xml.Xsl.Xslt.XsltLoader.LoadStylesheet(XmlReader reader, Boolean include)

    The above error show. then i modify after that no result come. Please help me. to seperate the value from ultimate picker check box list. Thank you.

     

     

     

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

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

    <xsl:param name="currentPage"/>

    <xsl:template match="/">

    <xsl:variable name="preNodes">
    <xsl:variable name="relatedContent" select="$currentPage/*[@id=1098]/*[@alias='selectTheBenefits']" />
    <xsl:variable name="nodeIds" select="umbraco.library:Split($relatedContent, ',')" />
    <xsl:for-each select="$nodeIds/value">

      <textarea>
        <xsl:copy-of select="$relatedContent" />
    </textarea>
    <xsl:copy-of select="umbraco.library:GetXmlNodeById(.)"/>
    </xsl:for-each>
    </xsl:variable>
    <xsl:variable name="nodes" select="msxml:node-set($preNodes)/node" />

    <xsl:if test="count($nodes) > 0">

    <div class="related-content">
    <h3>Related Content</h3>
    <ul>
                        <xsl:for-each select="$nodes">
        <li>
                                <href="{umbraco.library:NiceUrl(@id)}">
                                    <xsl:value-of select="@nodeName">
                                </xsl:value-of></a></li>
    </xsl:for-each></ul>
    </div>

    </xsl:if>

    </xsl:template>

    </xsl:stylesheet>

Please Sign in or register to post replies

Write your reply to:

Draft