Copied to clipboard

Flag this post as spam?

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


  • Alberto 1 post 71 karma points
    Jun 24, 2022 @ 14:54
    Alberto
    0

    Show site settings, display nested list

    Hi, I hope you can help me, I have troubles trying to show items from a list of links in my Site Settings. In the image I show how is my configuration in the backoffice. enter image description here

    This is the way I get the settings:

    var siteSettings = (SiteSettings)Umbraco.ContentAtRoot().SingleOrDefault(x => x.IsDocumentType("siteSettings"));
    

    In this part I only have to show the link from Item 1:

    @if (siteSettings.InternalLinks.Any())
                    {
                        
                    }
    
  • GregoryWilliams 9 posts 80 karma points
    Jun 28, 2022 @ 09:08
    GregoryWilliams
    0

    I am also having the same Issue. Did you get any solution?

  • Bo Jacobsen 610 posts 2409 karma points
    Jun 28, 2022 @ 10:24
    Bo Jacobsen
    0

    I guess your InternalLinks is your NedstedContent and inside that NestedContent you have a Multiple Url Picker.

    @using Umbraco.Cms.Core.Models
    
    @if (siteSettings.InternalLinks.Any())
    {
        @foreach (var item in siteSettings.InternalLinks)
        {
            Link firstLink = item.Value<IEnumerable<Link>>("linkList").FirstOrDefault();
            @firstLink.Name
        }
    }
    
  • 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