Copied to clipboard

Flag this post as spam?

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


  • Michael Jensen 29 posts 98 karma points
    Apr 26, 2014 @ 13:09
    Michael Jensen
    0

    Show Ancestor in macro

    Hey.

     

    cant sem to wrap my head around myt problem to day have uset the search and dint find the right topic "maby i do type the rong thing"

     

    i have this macro ware i lowe to have the ancestor name to show up it is macro iam gona use on many pages  so ancestor is gona change. it is the link i have made bolde i like to be the Ancestor

     

    I running Umbraco v6.1.6 (Assembly version: 1.0.5021.24867) on privat server

     

    / Michael

    @inherits umbraco.MacroEngines.DynamicNodeContext
    @*
        === Macro Parameters To Create ===
        Show:True   Alias:nodeId Name:Node ID    Type:Content Picker
    *@

    @{
        var startNodeID = Parameter.nodeId;
    }
    @if (startNodeID != null)
    {
        @* Get the start node as a dynamic node *@
        var startNode = Library.NodeById(startNodeID);
        
        if (startNode.Children.Where("Visible").Any())
        {

    <h6>Produkter i <a href=" Ancestor link">Ancestor Name</a> </h6>

            <ul>
                @foreach (var page in startNode.Children.Where("Visible"))
                { 
                    <li><a href="@page.Url">@page.Name</a></li>
                }
            </ul>
        }    
    }
  • Michael Jensen 29 posts 98 karma points
    Apr 29, 2014 @ 12:49
    Michael Jensen
    0

    Cant Eny one help me?

Please Sign in or register to post replies

Write your reply to:

Draft