Copied to clipboard

Flag this post as spam?

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


  • Ambert van Unen 175 posts 819 karma points c-trib
    Apr 30, 2020 @ 09:00
    Ambert van Unen
    0

    Rendering Partial by Macro yields different results then by template

    I currently have a nifty' blodslider' on my homepage. (Umbraco 8.4) I render it on my homepage template like this:

    @Html.Partial("~/views/partials/general/blogslider.cshtml", Model)
    

    I want to make this more dynamic for the client, and allow it to be added in a grid.

    I've added a Macro in the grid, that loads the MacroPartial "RenderBlogSlider".

    This is the contents of that MacroPartial:

    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    @{Html.RenderPartial("~/Views/partials/general/blogslider.cshtml", Model.Content); }
    

    And this works!, yeey!

    BUT

    Suddenly this also shows nodes that are marked as draft! Nodes that are unpublished!

    Now that should NOT happen in any way as far as I know. Is this a bug in Umbraco? Should I approach this in a different way?

  • Ambert van Unen 175 posts 819 karma points c-trib
    Apr 30, 2020 @ 09:18
    Ambert van Unen
    0

    Apparently an issue in Umbraco < 8.6

    https://github.com/umbraco/Umbraco-CMS/issues/6676

Please Sign in or register to post replies

Write your reply to:

Draft