Copied to clipboard

Flag this post as spam?

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


  • Kevin Lawrence 183 posts 350 karma points
    Mar 17, 2014 @ 10:40
    Kevin Lawrence
    0

    Umbraco.Field does not parse locallink - v6.1.6

    Hi all

    I've always tried to use the helper Umbraco.Field when rendering properties from nodes, however there seems to be an issue when using Umbraco.Field(currentPage, fieldAlias), it does not parse out the locallink urls.  It works fine if I use it on the current node using Umbraco.Field(fieldAlias).

    Work-around for this is to use GetValue and that seems to work fine, but I always thought Umbraco.Field was the preferred approach? Or am I wrong?

    Thanks

    Kev

  • Jeroen Breuer 4908 posts 12265 karma points MVP 4x admin c-trib
    Mar 17, 2014 @ 12:46
    Jeroen Breuer
    0

    Hello,

    If Umbraco.Field(fieldAlias) works, but Umbraco.Field(currentPage, fieldAlias) doesn't it might be a bug and you can report it at http://issues.umbraco.org/dashboard#newissue=yes (first search if it already exists). 

    I think Umbraco.Field was created for and easier transition from the umbraco:item which was used in UserControls. I prefer to use Model.Content.GetValue because I have extension methods for Model.Content so I can use the same object everywhere.

    Jeroen

  • Sebastiaan Janssen 5044 posts 15475 karma points MVP admin hq
    Mar 17, 2014 @ 23:16
    Sebastiaan Janssen
    1

    This is a known bug for which there is a workaround for versions lower than 7: http://issues.umbraco.org/issue/U4-2511

  • Kevin Lawrence 183 posts 350 karma points
    Mar 19, 2014 @ 17:12
    Kevin Lawrence
    0

    Thanks for the links guys, I've used the work-around for now. Cheers

Please Sign in or register to post replies

Write your reply to:

Draft