Copied to clipboard

Flag this post as spam?

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


  • aaronb 97 posts 116 karma points
    Aug 25, 2010 @ 19:15
    aaronb
    0

    NiceUrl returns blank for anything other than the homepage? Value is correct

    I'm having issues with NiceUrl not returning a link for anything other than the homepage.

    In my document type, I have a content picker called rotatorButtonLink. I'm trying to use NiceUrl to create the <a> tag and point it to whatever page was selected for rotatorButtonLink.

    If I pick the homepage in my content tree as the target, all works fine (home.aspx). if I select any other page in the site (all published), it doesn't return anything -  a href="" is the browser output.

    I'm using 4.5.1, and haven't modified anything as far as using legacy schema etc. so I assume I'm using the new schema.

    Thanks a ton for any help, I'm stumped.

    here's my stripped down xslt:

    <xsl:template match="/">
      <xsl:for-each select="$currentPage/ancestor-or-self::* [@level = 1]/* [string(umbracoNaviHide) != '1' and name() = 'RotatorPanel']">
       <xsl:variable name="rLink" select="umbraco.library:NiceUrl(rotatorButtonLink)" />

         <a>
        <xsl:attribute name="href"><xsl:value-of select='$rLink'/></xsl:attribute>
        <xsl:value-of select="umbraco.library:GetPreValueAsString(buttonType)"/>
        </a>
         </xsl:for-each>

     </xsl:template>

     

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Aug 25, 2010 @ 21:37
    Jan Skovgaard
    0

    Hi Aaron

    Have you tried to write <xsl:copy-of select="$rLink" /> to see the XML returned? Normally I would do it by wrapping <textarea></textarea> - but I think that can be a little confusing, since it will return a section for each time the loop runs...

    But this should give you an opportunity to see if what the returned XML output is and then you can take it from there.

    Hope this helps.

    /Jan

  • aaronb 97 posts 116 karma points
    Aug 25, 2010 @ 22:12
    aaronb
    0

    T hanks Jan,

    it shows /home.aspx for the ones that are set to the homepage, and is blank for the others.

    When I request just the value of rotatorButtonLink in xslt, I get the 4 digit ID correctly (1055 etc.)

    I now see that my top navigation which also uses niceurl has also stopped working.

    I've tried republishing the site from the top node, but no luck.

    Any more ideas would be much appreciated, thank you.

    I have also tried republishing each page individually, which solved the issue but now I have two sets of nodes showing on the site. So I think something is wrong with the site itself.

Please Sign in or register to post replies

Write your reply to:

Draft