Copied to clipboard

Flag this post as spam?

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


  • Pierre Breau 11 posts 121 karma points
    Sep 01, 2020 @ 23:22
    Pierre Breau
    0

    Content not displaying in partial view, variable selection is empty.

    I have created a document type with Title(textbox) media(media picker) content(richtext editor). From this I let umbraco generate a template. I have a root document type already I am using for this.

    I added the items I wanted into my Content section.

    Then I created a partial view to display these items in the view. My problem is when I use the umbraco query builder in my partial view it does not return any of the content.

    When I select another content in the query builder it works. I am not sure why it's not returning anything and when debugging the selection variable is empty as well.

    @{ var selection = Umbraco.ContentAtRoot().FirstOrDefault() .ChildrenOfType("myfunTabs") .Where(x => x.IsVisible()); } <ul> @foreach (var item in selection) { <li> <a href="@item.Url">@item.Name</a> </li> } </ul>

    I redid the document type a few times but without success, I am wondering if it has something to do with the parent root document type but unsure where to look or what to look for.

  • Pierre Breau 11 posts 121 karma points
    Sep 01, 2020 @ 23:26
    Pierre Breau
    100

    I think I got it I had to select 1 deeper down in the query builder. it's working now

Please Sign in or register to post replies

Write your reply to:

Draft