Search Results for

    Show / Hide Table of Contents
    View Source

    Interface IPreviewService

    Provides functionality for managing content preview mode.

    Namespace: Umbraco.Cms.Core.Services
    Assembly: Umbraco.Core.dll
    Syntax
    public interface IPreviewService
    Remarks

    Preview mode allows backoffice users to view unpublished content changes as they would appear on the front-end website.

    Methods

    View Source

    EndPreviewAsync()

    Exits preview mode for the current request.

    Declaration
    Task EndPreviewAsync()
    Returns
    Type Description
    Task

    A task representing the asynchronous operation.

    View Source

    IsInPreview()

    Determines whether the current request is in preview mode.

    Declaration
    bool IsInPreview()
    Returns
    Type Description
    bool

    true if the current request is in preview mode; otherwise, false.

    View Source

    TryEnterPreviewAsync(IUser)

    Enters preview mode for a given user.

    Declaration
    Task<bool> TryEnterPreviewAsync(IUser user)
    Parameters
    Type Name Description
    IUser user

    The user entering preview mode.

    Returns
    Type Description
    Task<bool>

    true if preview mode was entered successfully; otherwise, false.

    View Source

    TryGetPreviewClaimsIdentityAsync()

    Attempts to get the claims identity for the current preview session.

    Declaration
    Task<Attempt<ClaimsIdentity>> TryGetPreviewClaimsIdentityAsync()
    Returns
    Type Description
    Task<Attempt<ClaimsIdentity>>

    An attempt containing the claims identity if in preview mode; otherwise, a failed attempt.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX