Copied to clipboard

Flag this post as spam?

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


  • Jameskn 64 posts 78 karma points
    Aug 16, 2010 @ 22:54
    Jameskn
    0

    4.5.1 And NiceUrl

    <?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="/">

    <!-- start writing XSLT -->
      <ul>
    <xsl:for-each select="$currentPage/*">
      <xsl:if test="string(@id) != '' ">

         <!-- do this -->
        <li><href="{umbraco.library:NiceUrl(@id)}"><xsl:value-of select="@nodeName"/></a></li>
     
    </xsl:if>
    </xsl:for-each>
        </ul>
    </xsl:template>

    </xsl:stylesheet>

     

    So I am just a touch stuck.. really am scratching my head . This will produce a nice list but the NiceUrl part just returns a blank . I have checked @id it returns the id as you would expect .. I have to say I am stuck. I assume my umbraco build is corrupted or something. 

    I am so hoping someone can view above and just say.. Nope you are being dumb it is xx . ;) 

    I am using  <UseLegacyXmlSchema>true</UseLegacyXmlSchema> in the umbraco config file. 

    umbraco v 4.5.1 (Assembly version: 1.0.3858.40498

    Any help would be great. 

    Many thanks, 

    Cheers, 

    James

  • Sascha Wolter 615 posts 1101 karma points
    Aug 17, 2010 @ 00:51
    Sascha Wolter
    0

    Hi James,

    maybe it's worth checking the /App_Data/umbraco.config file if the legacy Xml Schema is generated alright.

    Otherwise the above looks okay to me, you could maybe try the following although I don't expect anything fancy coming from it:

    count: <xsl:value-of select="count($currentPage/descendant::node)" /><br />
    <ul>
    <xsl:for-each select="$currentPage/descendant::node">
      <li>
        <textarea style="width: 200px; height: 200px;">
          <xsl:copy-of select="current()" />
        </textarea><br />
        id: <xsl:value-of select="current()/@id" /><br />
        name: <xsl:value-of select="current()/@nodeName" /><br />
        <a href="{current()/@id}"><xsl:value-of select="current()/@nodeName" />
      </li>
    </xsl:for-each>
    </u>

    Sascha

  • Jameskn 64 posts 78 karma points
    Aug 17, 2010 @ 01:19
    Jameskn
    0

    Hi Sascha, 

    Thanks so much for reply.. well I am pretty sure it is now a site issue. /cry basically you prompted me to try to re-publish the site. It has duplicated all of the nodes .. and I tried again re-publish I now have 3 times as many nodes. Methinks .. I might have a problem. The site has 800 pages so and I have just upgraded it locally on my laptop to test it.. At the moment though it looks like 4.5.1 is not going to love me or this site. I will have to look at why the umbraco manager has only one copy of the page but the publish page looks to be able to find 3 times as many pages and no url. Either way this upgrade is a bit of drama to say the least .. Thankfully not in a live environment. 

    If I found my issue I will post it as I doubt I will be the last person with this problem. 

    James

Please Sign in or register to post replies

Write your reply to:

Draft