Copied to clipboard

Flag this post as spam?

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


  • Naveed Ali 161 posts 426 karma points
    Apr 26, 2016 @ 11:01
    Naveed Ali
    0

    What replaces Library?

    Hi I am transfering some code form umbraco 4 to the new version 7..

    what has replaced "Library.NodeByID"??

    Below is an example of it being used

    <ul class="green-btns clearfix">
    @{
        int j = 0;
        foreach (var action in rootNode.actionLinks)
        {
            if (j < 3)
            {
                string target = action.newwindow == "1" ? " target=\"_blank\"" : "";
    
                <li><a href="@(append + Library.NodeById(action.link).Url)" @Html.Raw(target) class="mm-button"><span>@(string.IsNullOrWhiteSpace(action.title) ? Library.NodeById(action.link).Name : action.title)</span></a></li>
                j++;
            }
            else
            {
                break;
            }
        }
    }
    

    Thanks

    Nav

  • Steve Morgan 1350 posts 4460 karma points c-trib
    Apr 26, 2016 @ 11:09
    Steve Morgan
    0

    Hi,

    Depends where this code is (what it inherits) but try

     Umbraco.TypedContent(action.link);
    

    HTH

    Steve

  • Naveed Ali 161 posts 426 karma points
    Apr 26, 2016 @ 15:27
    Naveed Ali
    0

    I managed to do it by using Umbraco.Content

  • 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