Copied to clipboard

Flag this post as spam?

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


  • Wihlborg Inge 21 posts 161 karma points
    Sep 26, 2018 @ 09:49
    Wihlborg Inge
    0

    Sections does not render

    Hi Guys,

    I still struggle with translating my site based on Umazel theme. I have added some new Vorto properties on the document type Content Page to be able to translate the pages.

    When I create a new page using this modified document type all seems fine except that any sections that I add under the Page Elements does not render.

    When debugging the template pageInner.cshtml and the code part

    if (currPage.Descendant(FolderSections.ModelTypeAlias) != null)
        {
            var items = currPage.Descendant(FolderSections.ModelTypeAlias).Children();
            foreach (IPublishedContent item in items)
            {
                //Pass a value to make specific partials be pushed down a bit if no background image is set and they are first on the list.
                bool pushDown = string.IsNullOrEmpty(currPage.PageBackgroundImage) && item.Equals(items.First());
    
                bool useHorizontalRule = (item.Equals(items.Last())) ? false : true;
    
                @Html.Partial("PageSectionRenderer", item, new ViewDataDictionary { { "useHorizontalRule", useHorizontalRule }, { "pushDown", pushDown } })
    
    
            }
        }
    

    it seems that the code does not find any descendants to the Page Elements with the Aliastype ”folderSections”. This is very strange, and I cannot figure out why it works when I am using the preview function in Backoffice.

    Is there anybody who can guide me?

    BR Inge

  • Wihlborg Inge 21 posts 161 karma points
    Sep 26, 2018 @ 13:23
    Wihlborg Inge
    0

    One more notable thing is, when deploying the same code and content to UaaS the problem disappears there.

    When running the site locally in Visual Studio 2017 I have the problem above.

  • Wihlborg Inge 21 posts 161 karma points
    Sep 27, 2018 @ 06:53
    Wihlborg Inge
    100

    I managed to solve the issue by cloning down a new fresh copy from project on UaaS.

    But I still cannot figure out why it was ok when previewing it and not ok when I closed preview.

    Maybe it has somethin to do with Visual Studio.

Please Sign in or register to post replies

Write your reply to:

Draft