Copied to clipboard

Flag this post as spam?

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


  • Martin 6 posts 26 karma points
    Mar 14, 2011 @ 18:04
    Martin
    0

    Inline xslt getItem?

    On my page I have a contentPicker called theRecipe, and the target node I selected in this contentPicker has a textstring field called recipeTitle.

    In my template I'm trying to do an inline xslt getItem for recipeTitle, like this:

    <umbraco:Item field="theRecipe" xslt="umbraco.library:GetItem({0},'recipeTitle')" runat="server"></umbraco:Item>

    but this returns nothing. What am I doing wrong?

    (I'm using Umbraco v4.7.0.RC)

  • Casey Neehouse 1339 posts 483 karma points MVP 2x admin
    Mar 14, 2011 @ 20:02
    Casey Neehouse
    0

    Could try this..  Sometimes inline code works :P

    <%= umbraco.library.GetItem(umbraco.library.GetItem("theRecipe"),"recipeTitle") %>

     

  • Martin 6 posts 26 karma points
    Mar 14, 2011 @ 21:51
    Martin
    0

    Sorry, that does not work.

    I should be able to do it in the umbraco:Item. But I'm guessing there is something wrong with my xslt snippet.

  • Sascha Wolter 615 posts 1101 karma points
    Mar 14, 2011 @ 23:48
    Sascha Wolter
    0

    Hi Martin,

    I am not really sure if you can access other nodes than the current via inline xslt, here is what I would try out:

    <umbraco:Item field="theRecipe" xslt="umbraco.library:GetXmlNodeById({0})/recipeTitle" runat="server"></umbraco:Item>

    If that doesn't work how about creating an Xslt macro for that, or does it need to be inline Xslt?

    Cheers,

    Sascha

  • Martin 6 posts 26 karma points
    Mar 15, 2011 @ 00:19
    Martin
    0

    Sascha: That worked great! Thanks alot!

  • Sascha Wolter 615 posts 1101 karma points
    Mar 15, 2011 @ 00:25
    Sascha Wolter
    0

    Excellent, good to know that one can do this inline as well. :)

  • 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