Copied to clipboard

Flag this post as spam?

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


  • RolandWolters 32 posts 32 karma points
    Jan 27, 2009 @ 12:11
    RolandWolters
    0

    Link to parentnode when no subnodes

    Hi,

    I bet this is easy but i am stuck anyway...

    I want a list of subpages, and when there are no subpages i want a link back to the parent node.

    Here is the xslt i use:


    ]>

    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"
    exclude-result-prefixes="msxml umbraco.library">
















    where it says "

    move up

    " the link to the parentnode must be...

    Who has enough wisdom to solve this? :)


    edit: I tried this (based on the wiki)




    but no luck :(

  • Finn 86 posts 50 karma points
    Jan 27, 2009 @ 12:40
    Finn
    0

    I got these code fragments (don’t recall from where) that might come in handy for you:










    Hope it can halp you on the way.

    /Finn

  • RolandWolters 32 posts 32 karma points
    Jan 27, 2009 @ 16:16
    RolandWolters
    0

    Ok thnx, this did help, but stil ther is this strange behaviour...

    Initially I wanted it so, that when there are no subpages, a link back to the parent is shown.
    That works ok, thnx for the tips

    But now i also want to show the link-to-parent as first option in de menu. Strange enough I cannot seem to do that.... keep getting an error.

    This is the working peace of xsl:


    ]>

    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"
    exclude-result-prefixes="msxml umbraco.library">


















    I put the declaration of the @parentId varaiable on top, so I could use it also when there are subpages.
    BUT THAT DOES NOT WORK.

    Here is the faulty code:



    ]>

    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"
    exclude-result-prefixes="msxml umbraco.library">










    this is the error: Error occured
    System.Xml.XPath.XPathException: Function 'umbraco.library:NiceUrl()' has failed. ---> System.OverflowException: Value was either too large or too small for an Int32.
    at System.Convert.ToInt32(Double value)

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jan 27, 2009 @ 16:25
    Dirk De Grave
    0

    Hi,

    Any time you're feeding NiceUrl() with a variable ($ syntax), surround the construct with a

Please Sign in or register to post replies

Write your reply to:

Draft