Copied to clipboard

Flag this post as spam?

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


  • Martin 26 posts 21 karma points
    Mar 30, 2009 @ 13:43
    Martin
    0

    How to pass a macro parameter from masterpage to XSLT?

    Hi there, I can't figure out why this won't work.

    My masterpage contains the following:

    [code]

    [/code]

    1413 is the ID of the node I picked through the contentPicker, when I inserted the macro on the masterpage.

    I want to pass the "datasource" parameter through to the NewsBox xslt.

    In my NewsBox.xslt I have a parameter

    when I try to retrieve the value of the datasource parameter, nothing happens.



    No output :(

    [code]











    [/code]

  • Martin 26 posts 21 karma points
    Mar 30, 2009 @ 14:00
    Martin
    0

    using solved the problem. Apparently I needed to select the macro/datasource , before I could use it.

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Mar 30, 2009 @ 16:02
    Douglas Robar
    0

    Glad you got it working!

    I'm not sure if it will make any difference, but typically one uses the

  • Martin 26 posts 21 karma points
    Mar 31, 2009 @ 14:08
    Martin
    0

    That would also work :)

    Now I've got a new problem.

    In the - News , I want to use the NiceUrl, so I can link to the $datasource.
    Since $datasource returns a string (with the id of the node I picked with the contentPicker when I inserted the macro), I need to somehow convert it to an int.
    Ive tried this:



    but that doesn't work :(

    I've also tried $datasource/self::node/@id , and that didn't work either.

    How can I fix this?

    using:
    is not possible, since I'm not inside a for-each loop at this point.



    regards,
    Martin

  • Martin 26 posts 21 karma points
    Mar 31, 2009 @ 15:34
    Martin
    0

    Ok, I found a solution to my problem.. But I think there might be some kind of bug in Umbraco 4.

    [code]





    [/code]

    Didn't work. But (Should be the same as the above code):

    [code]
    - Reviews
    [/code]

    Worked fine :D

  • Douglas Robar 3570 posts 4711 karma points MVP ∞ admin c-trib
    Mar 31, 2009 @ 20:10
    Douglas Robar
    0

    You can't mix-n-match the {} and value-of notation. You've found that you can use {} inside a tag property, but not within an xsl:value-of.

    Both of these should produce the same result:

    [code]



    [/code]

    [code]- Reviews[/code]

    cheers,
    doug.

  • Martin 26 posts 21 karma points
    Apr 01, 2009 @ 08:41
    Martin
    0

    Arh, thanks a lot! :D

  • 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