Copied to clipboard

Flag this post as spam?

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


  • Rafał Będkowski 1 post 71 karma points
    Dec 20, 2015 @ 13:43
    Rafał Będkowski
    0

    Acceess do Children properties

    I'm new to Umbraco. I am in the process of doing a new own site. I have a file Home. In it loading all of his children (I make navigation and site structure). In the files "children" have the code that loads to the Home (if you want).

    I do not have access to properties contained in the files of children.

    How do I get to them? In an headTitle and headText.

    Home:

    @{
        var childrens = @CurrentPage.Children.Where("Visible");
    }
    @{
        Html.RenderPartial("Navigation");
    
    
        if (childrens != null)
        {
            foreach (var children in childrens)
            {
                Html.RenderPartial((string)children.DocumentTypeAlias, Model.Content);
                Html.RenderPartial("Separator");
            }
            ;
        }
    ;
    }
    

    Head (Partial):

                    <p id="intro_title">@Model.Content.GetPropertyValue("headTitle")</p>
                    <p id="intro_text">@CurrentPage.headText</p>
                    <p style="text-align: center">
                        <button onclick="window.location.href = '#third'" type="button" class="btn btn-lg btn-toolbar btn-warning">@Umbraco.Field("buttonName", altText: "MORE...")</button>
                    </p>
                </div>
            </div>
        </div>
    </div>
    

Please Sign in or register to post replies

Write your reply to:

Draft