Copied to clipboard

Flag this post as spam?

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


  • Mike Cave 24 posts 162 karma points
    Mar 20, 2018 @ 15:54
    Mike Cave
    0

    Content ok in Preview but not being published

    Hi Guys,

    I have an issue with content not being published. I have a macro partial to show some content. It displays ok on two pages but I cannot get it to be published in a third page.

    The macro for the third page shows ok in Preview but doesnt show when I have published it.

    I created a text page default template under my 3rd page, added in a rich text editor and then clicked on the macro box and added the name of my macro. this works for the first two pages, but will not publish on the third page. I have tried this 8 or nine time and it still ownt work, but it Will show in preview mode.

    Any clues as to what may be wrong?

    thanks, Mike. ! image of partial here

    and this is the working preview working preview here

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Mar 20, 2018 @ 16:16
    Alex Skrypnyk
    0

    Hi Mike

    Check, please, Umbraco logs => /App_Data/Logs are there any issues?

    Alex

  • Mike Cave 24 posts 162 karma points
    Mar 20, 2018 @ 16:50
    Mike Cave
    0

    Hi Alex,

    I have one error:

     2018-03-20 15:46:41,028 [P11020/D2/T35] INFO  umbraco.content - Saved Xml to file.
    

    2018-03-20 15:48:02,122 [P11020/D2/T20] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Web.Trees.TreeController 2018-03-20 15:48:02,122 [P11020/D2/T20] INFO Umbraco.Core.PluginManager - Completed resolution of types of Umbraco.Web.Trees.TreeController, found 0 (took 0ms) 2018-03-20 15:48:13,559 [P11020/D2/T43] WARN umbraco.macro - Error loading MacroEngine script (file: /Custom/WD_OurFeatureWork.cshtml, Type: ''. Exception: System.ArgumentNullException: Value cannot be null. Parameter name: node at umbraco.MacroEngines.DynamicNodeContext.SetMembers(MacroModel macro, INode node) at umbraco.MacroEngines.RazorMacroEngine.InjectContext(WebPage razorWebPage, MacroModel macro, INode currentPage) at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage) at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage) at umbraco.macro.loadMacroScript(MacroModel macro) at umbraco.macro.renderMacro(Hashtable pageElements, Int32 pageId) 2018-03-20 15:48:15,481 [P11020/D2/T23] INFO Umbraco.Core.PluginManager - Starting resolution types of Umbraco.Web.Trees.TreeController

    Thanks

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Mar 20, 2018 @ 17:17
    Alex Skrypnyk
    0

    So we have to find a place in WD_OurFeatureWork.cshtml where error occurs and fix it

    Show the code of WD_OurFeatureWork.cshtml

    /Alex

  • Mike Cave 24 posts 162 karma points
    Mar 20, 2018 @ 17:19
    Mike Cave
    0

    Hi Alex,

    The partial works corredctly in two other Umbraco pages, so I dont think the code is wrong...

  • Mike Cave 24 posts 162 karma points
    Mar 20, 2018 @ 17:24
    Mike Cave
    0
    @using umbraco.MacroEngines
    

    @inherits umbraco.MacroEngines.DynamicNodeContext

    Our work works

    From marketing firsts, to pioneering campaigns, to motivating solutions
    – here’s a selection of what we’ve done…


    @{ var SiteNode = Model.AncestorOrSelf(); } @foreach (var homeNode in SiteNode.Children.Where("Visible")) { if (homeNode.Name == "Our work") { var _cnt = 1;
    @foreach (var page in homeNode.Children.Where("Visible")) { foreach (var item in page.Children.Where("Visible")) { var url = ""; if (item.isFeatured && _cnt <= 3) { try { var _img2 = Model.MediaById(item.projectThumbnail); url = _img2 == null ? "" : _img2.Url; var arr = url.Split(','); url = @arr[0].Replace("{src: ", "").Replace("'", ""); } catch (Exception ex) { } if (url != "") { _cnt++;

    @item.Name

    VIEW WORK
    } } } }
                    }
                }
                <div class="row">
                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 text-center">
                        <br /><br />
                        <a href="/our-work" class="btn">VIEW ALL WORK </a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Mar 20, 2018 @ 17:38
    Alex Skrypnyk
    0

    But error says that error is inside this macro, so something can be fixed

  • Alex Skrypnyk 6131 posts 23950 karma points MVP 7x admin c-trib
    Mar 22, 2018 @ 09:13
    Alex Skrypnyk
    0

    Hi /mike

    Did you solve the issue? Please, share with our community.

    /Alex

  • Mike Cave 24 posts 162 karma points
    Mar 22, 2018 @ 09:18
    Mike Cave
    0

    Hi Alex,

    No I didn't solve the issue. The partial can still be used, but not in the default Text Page template. I have had to put it to one side at the moment as I have had to work on other projects. I will spend time this weekend trying to solve the issue. It may have something to do with the template not allowing macro's (?)

    thanks, Mike

Please Sign in or register to post replies

Write your reply to:

Draft