Copied to clipboard

Flag this post as spam?

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


  • Michiel 137 posts 294 karma points
    Oct 19, 2011 @ 16:22
    Michiel
    0

    Need help with XSLT for the first child node of the current node

    I am configuring a Contour form and after the user has submitted the form I want to redirect them to the first child node of the page on which the form is placed.

    But my XSLT is very rusty, I have last used it 7 years ago and never with Umbraco. Can someone point me in the right direction?

    Thank you!

  • Chriztian Steinmeier 2726 posts 8320 karma points MVP 4x admin c-trib
    Oct 20, 2011 @ 00:37
    Chriztian Steinmeier
    0

    Hi Michiel,

    Doesn't Contour have a behavior like that? I seem to recall a "Send to page" property on the "Settings" tab of a Form...

    Otherwise, do you want to perform a browser redirect or just render the contents of the child page?

    /Chriztian

  • Michiel 137 posts 294 karma points
    Oct 20, 2011 @ 10:34
    Michiel
    0

    Yeah, it has a redirect to page option, you can pick a node or enter XSLT. Because I need to reuse the form across multiple sites, I want the behavior to be: redirect to first child node. And I need to use the XSLT option for that.

     And I'd prefer a redirect, because that's easiest to measure as a goal conversion in Google Analytics.

     

     

  • Dan Okkels Brendstrup 101 posts 197 karma points
    Nov 16, 2011 @ 16:00
    Dan Okkels Brendstrup
    1

    Hi Michiel,

    I'm not sure what the implied context is when you enter an XPath expression for Contour, but presuming it recognizes the standard $currentPage variable, then this should work:

    $currentPage/*[@isDoc][1]

    ...which basically just points to the first child document node under the current page. Instead of the "*" you can of course specify any doctype, in which case the [@isDoc] test becomes superfluous, e.g.:

    $currentPage/Page[1]

    Will that work?

  • Michiel 137 posts 294 karma points
    Nov 17, 2011 @ 10:33
    Michiel
    0

    Hi Dan,

    Thanks for your suggestion. Unfortunately, anything I enter into the XPath field results in an exception ("input string was not in a correct format") on the website when submitting the form. I have submitted that to support, when it is resolved I will try your XPath.

    Thanks!

     

     

  • Dan Okkels Brendstrup 101 posts 197 karma points
    Nov 17, 2011 @ 10:44
    Dan Okkels Brendstrup
    0

    Hmm, I can't find any documentation on the redirect-to-XPath functionality, but perhaps the $currentPage variable is unnecessary. How about simply this:

    ./*[@isDoc][1]

    Will that work?

  • Michiel 137 posts 294 karma points
    Nov 17, 2011 @ 11:44
    Michiel
    0

    Not a single XPath query I have tried (and i tried lots) works, they all result in the same exception when submitting the form.

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies