Copied to clipboard

Flag this post as spam?

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


  • Paul Griffiths 370 posts 1021 karma points
    Sep 17, 2016 @ 11:07
    Paul Griffiths
    0

    unpublished pages still showing in umbraco

    Hi,

    I am after some information about un-publishing pages in umbraco and how this works out the box. I have a site where I need un-publish pages on a regular basis and then maybe publish after some time. When I un-publish the page in the back office using the unpublish at property I can see that the node gets updated with a small green indicator to suggest that it has been unpublished. However, when I browse to the front end the node that I un-published is still visible.

    Am I wrong to assume that this should work out the box or have you got to specify it in the razor markup when outputting child nodes for example?

    Here is my markup

     foreach (var player in firstTeamPlayers)
                    {
                        <!--Process the media image-->
                        var imageRef = Umbraco.TypedMedia(player.GetPropertyValue<int>("image"));
                        var imgUrl = imageRef != null ? imageRef.GetCropUrl(380, 380) : "/Content/images/placeholders/md-profile-placeholder.jpg";
    
                        <div class="col-md-3 col-sm-6 margin-btm-20">
                            <div class="person-section">
                                @if (player.HasValue("teamCaptain") || player.HasValue("teamCaptain"))
                                {
                                    if (player.GetPropertyValue<bool>("teamCaptain"))
                                    {
                                        <span class="captain">Captain</span>
                                    }
                                    if (player.GetPropertyValue<bool>("viceCaptain"))
                                    {
                                        <span class="captain">Vice Captain</span>
                                    }
    
                                }
                                <a href="@player.Url" title="@player.GetPropertyValue("fullName")"><img src="@imgUrl" class="img-responsive" alt="@player.Name" title="@player.Name"></a>
                                <div class="person-desc">
                                    <h3><a href="@player.Url" title="@player.Name">@player.GetPropertyValue("fullName")</a><span>@player.GetPropertyValue("position")</span></h3>
                                    @{var mainContent = library.RemoveFirstParagraphTag(player.GetPropertyValue<string>("mainContent")); }
                                    @if (!string.IsNullOrEmpty(mainContent))
                                    {
                                        <p>@Umbraco.Truncate(library.StripHtml(mainContent), 50, true)</p>
                                    }
                                    else
                                    {
                                        <p>Profile information for @player.Name is coming soon.</p>
                                    }
                                </div>
                            </div><!--person section end-->
                        </div><!--person col end-->
                    }
    

    enter image description here enter image description here

    im using Umbraco version 7.4.3 assembly: 1.0.5948.18141

    Any advice would be good Thanks Paul

  • Michaël Vanbrabandt 863 posts 3348 karma points c-trib
    Sep 18, 2016 @ 09:47
    Michaël Vanbrabandt
    0

    Hi Paul,

    can you clear the cache of your browser and try it again?

    /Michaël

  • Paul Griffiths 370 posts 1021 karma points
    Sep 18, 2016 @ 12:51
    Paul Griffiths
    0

    Hi,

    Thanks for the response.

    Yes I set the browsers cache and also tried in incognito and it was still being displayed.

    Thanks Paul

  • Ivan Ponomarenko 20 posts 105 karma points
    Sep 18, 2016 @ 13:44
    Ivan Ponomarenko
    0

    Hi Paul,

    Small green plus is indicated that you can't editing content with your permissions, and your changes need be published with roles "Administrator" or "Editor". Check your roles, maybe you have role "Writer"?

    Regards, Ivan

  • Paul Griffiths 370 posts 1021 karma points
    Sep 18, 2016 @ 15:07
    Paul Griffiths
    0

    Hi Ivan,

    Yes i am the administrator and the account i am using has full permission. The green icon only ever appears when i set the un-publish at value in properties.

    It goes away when i remove teh un-publish value

    Many thanks Paul

  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Sep 19, 2016 @ 00:11
    Nathan Woulfe
    1

    Hi Paul

    You wouldn't happen to be setting an unpublishAt value that has already passed? We've had issues in the past where an editor would set an unpublishAt, send the change into our approval workflow, then the workflow not be completed until after the unpublishAt time had lapsed, leaving the node published...

  • Paul Griffiths 370 posts 1021 karma points
    Sep 19, 2016 @ 06:32
    Paul Griffiths
    0

    Hi Nathan,

    Thanks for your input.

    Each time I have tried using the un-publish at I have always selected the now option and the field is populated with the current dateTime.

    Maybe when I get into work I should try setting the un-publish at value to a dateTime that's a minute into the future and see if this approach works.

    I will let you know

    Thanks

  • Paul Griffiths 370 posts 1021 karma points
    Sep 19, 2016 @ 08:45
    Paul Griffiths
    0

    Hi All,

    If I set the un-publish at date in the future (i set it 1 minute ahead) and don’t use the now option then this works as expected. Maybe this is a bug in this version but for now this is an adequate work around.

    When the page unpublished it becomes grey out in the content tree which is more like the expected behaviour. The little green icon I reported does not appear.

    Thanks to everyone who responded ;)

    Many thanks Paul

  • Nathan Woulfe 447 posts 1665 karma points MVP 5x hq c-trib
    Sep 19, 2016 @ 09:01
    Nathan Woulfe
    1

    Hi Paul

    Good to hear you got it sorted - makes sense, that setting unpublishAt to now won't work, as the time is in the past as soon as it is set. Sounds like a bug, either the date picker should be constrained to a time x minutes in the future, or passed dateTimes should still unpublish.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies