Copied to clipboard

Flag this post as spam?

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


  • Jon Behrens 53 posts 77 karma points
    Nov 20, 2012 @ 23:40
    Jon Behrens
    0

    xslt code works inside a macro but does not work inline

    Hello,

    I'm using umbraco 4.9

    The xslt code is:

    <pre>

    <umbraco:Item field="updateDate" xslt="umbraco.library:FormatDateTime({0}, 'H.mm:dMMMyy')" runat="server" />

    </pre>

    The following code works just fine on the same page (I just don't care for the formatting)

    <pre>

    <umbraco:Item field="updateDate" formatAsDateWithTime="true" formatAsDateWithTimeSeparator=":" runat="server" />

    </pre>

    As I said the xslt code also works fine inside a macro. I've been completely unable to get inline xslt to work with this version of Umbraco. Even code that worked with 4.5.2 doesn't work. I'm obviously missing something simple.

    Thanks for the help

    Jon

     

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Nov 20, 2012 @ 23:46
    Chriztian Steinmeier
    0

    Hi Jon,

    Could you try wrapping the {0} thing in single quotes? If Umbraco does what I think it does, it will insert the value (not the name) into the XPath expression, and then it's actually a literal string, which should be in quotes... so:

    <umbraco:Item field="updateDate" xslt="umbraco.library:FormatDateTime('{0}', 'H.mm:dMMMyy')" runat="server" />

    /Chriztian

  • Jon Behrens 53 posts 77 karma points
    Nov 20, 2012 @ 23:49
    Jon Behrens
    0

    Thank you Chriztian - unfortunately that didn't change anything.

  • Chriztian Steinmeier 2798 posts 8788 karma points MVP 8x admin c-trib
    Nov 20, 2012 @ 23:56
    Chriztian Steinmeier
    0

    Arg - just remembered that there was something about this - it's a bug, you can see it here on the tracker.

    There seems to be a patched umbraco.dll that you can download somewhere in the comments...

    /Chriztian  

  • Jon Behrens 53 posts 77 karma points
    Nov 21, 2012 @ 00:03
    Jon Behrens
    0

    That did it. Thanks very much Chriztian.

Please Sign in or register to post replies

Write your reply to:

Draft