Copied to clipboard

Flag this post as spam?

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


  • Joao Baptista 8 posts 58 karma points
    Sep 30, 2014 @ 17:27
    Joao Baptista
    0

    Helper returns all items including unpublished ones.

    Hi guys

    this happens in Umbraco 7.1.6.

    I'm trying to build a nav system, but the helper is return all nodes including unpublished ones. I thought that the helper would only return published content?

    Code snippet below:

    @foreach (var page in Umbraco.TypedContent(1102).Children)
            {
                <li class="@(page.Children.Any() ? "ddm" : null)">
                    <a href="@page.Url">@page.Name</a>
                    @foreach (var child in page.Children.Where(a=>a.IsVisible()))
                    {
                        <p>@child.Name</p>
                    }
                </li>
            }
    

    Anyone can see where I'm going wrong?! I get all nodes including unpublished ones even with the IsVisible method in the query.

    Any thoughts?!

    Thank you all!

Please Sign in or register to post replies

Write your reply to:

Draft