Copied to clipboard

Flag this post as spam?

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


  • Adriano Fabri 383 posts 1280 karma points
    Apr 12, 2017 @ 09:47
    Adriano Fabri
    0

    What happens when a page is in preview mode and in the backoffice?

    Hi, I am really interested to your package but I want to be sure that the counter is not incremented when a page is in preview mode and when I work with the node in backoffice.

    Can you tell me something about this?

    Thank you

    Adriano

    Umbraco v7.5.13
    SQL Server 2016
    
  • Cimplex 111 posts 573 karma points
    Apr 13, 2017 @ 06:52
    Cimplex
    100

    Sure, try this:

    @if (!(UmbracoContext.InPreviewMode || Request.QueryString["dtgePreview"] == "1"))
    {
        CounterService.Increment(Model.Content.Id);
    }
    

    // Herman

  • 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