Copied to clipboard

Flag this post as spam?

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


  • encoredatas 4 posts 73 karma points
    Jan 25, 2018 @ 15:42
    encoredatas
    0

    Macro and Partial Views rendering deleted content.

    Hello Experts,

    I'm new to Umbraco , but not to developing. I'm noticing an issue in Umbraco with deleted content. A client of mine has deleted an event in the BackOffice , but the macro I created still pulls in and renders the deleted content. I have emptied the recyle bin but still shows up. I thought Umbraco only shows published content. Therefore, I'm puzzled why it can still be published. Here is the code in my macro. Thanks in advance!!

    @using ContentModels = Umbraco.Web.PublishedContentModels;
    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage
    @using Umbraco.Web;
    @inherits Umbraco.Web.Macros.PartialViewMacroPage
    @{
    
        var homePage = CurrentPage.AncestorsOrSelf(1).First();
        var Events = homePage.eventOverview.First();
        var EventItems = Events.eventItem.OrderBy("eventDate");
        var sectionTitle = Model.MacroParameters["sectionTitle"] != null ? Model.MacroParameters["sectionTitle"] : String.Empty;
    
    }
    
    @if (EventItems.Any())
    {
        <!--Sidebar Page-->
        <div class="sidebar-page">
            <div class="auto-container">
                <div class="row clearfix">
                    <!--Content Side-->
                        <section class="four-column current-projects">
                            <div class="auto-container">
                                <div class="sec-title clearfix">
                                    <h2 class="skew-lines">DCAC <strong>Events</strong></h2>
                                </div>
                                <div class="row clearfix">
    
                                    @foreach (var eventItem in EventItems)
                                    {
                <!--Event List -->
                                        if (Umbraco.GetPreValueAsString(eventItem.eventType) == "DCAC")
                                        {
    
                                            <div class="col-md-3 col-sm-6 col-xs-12 column project-column wow fadeInLeft" data-wow-delay="0ms" data-wow-duration="1000ms" style="min-height:450px !important;">
                                                <article class="column-inner hvr-float-shadow">
                                                    <figure class="image-box">
    
                                                        <a href="@eventItem.Url" target="_self">
                                                            <img src="@Umbraco.Media(eventItem.eventImage.ToString()).GetCropUrl("Medium")" />
                                                        </a>
                                                        <div class="icon-box">
                                            `            </div>
                                                    </figure>
                                                    <div class="lower-part">
                                                        <div class="text">
                                                            <h3>@eventItem.Name</h3>
                                                            <h5><b>Date and Time:</b></h5><p>@eventItem.eventDate.ToString("MM/dd/yyyy h:mm tt")</p>
                                                            <p>@eventItem.eventDescription</p>
                                                        </div>
                                                    </div>
                                                </article>
                                            </div>
                                        }
                                    }
                                </div>
                            </div>
                        </section>
                    <!--Content Side-->
                </div>
            </div>
        </div>
    }
    
  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Jan 25, 2018 @ 15:48
    Alex Skrypnyk
    100

    Hi

    Try to republish all site and nodes that you are using

    Also, please check is there some cache in your solution?

    Alex

  • Nik 1614 posts 7260 karma points MVP 7x c-trib
    Jan 25, 2018 @ 15:50
    Nik
    0

    Hi encoredatas,

    Following on from Alex's comment. Have you checked your macro settings? There is an option on macro's to enable caching which could be causing the issue you are seeing.

    If caching isn't enabled on the Macro, how are you calling the macro in the first place?

    Thanks,

    Nik

  • encoredatas 4 posts 73 karma points
    Jan 25, 2018 @ 15:52
    encoredatas
    2

    Thanks. It worked republishing the whole site. Nik to answer your question, I made sure the cache options where off. You guys are cool and nice. Thanks!

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Jan 25, 2018 @ 15:53
    Alex Skrypnyk
    0

    You are welcome, have a great day!

Please Sign in or register to post replies

Write your reply to:

Draft