Search Results for

    Show / Hide Table of Contents
    View Source

    Class TemplateSavingNotification

    A notification that is used to trigger the IFileService when the SaveTemplate method is called in the API.

    Inheritance
    object
    StatefulNotification
    ObjectNotification<IEnumerable<ITemplate>>
    CancelableObjectNotification<IEnumerable<ITemplate>>
    CancelableEnumerableObjectNotification<ITemplate>
    SavingNotification<ITemplate>
    Namespace: Umbraco.Cms.Core.Notifications
    Assembly: Umbraco.Core.dll
    Syntax
    public class TemplateSavingNotification : SavingNotification<ITemplate>, IStatefulNotification, ICancelableNotification, INotification
    Remarks

    This notification is cancelable, allowing handlers to prevent the save operation by setting Cancel to true.

    Constructors

    View Source

    TemplateSavingNotification(IEnumerable<ITemplate>, EventMessages)

    Initializes a new instance of the TemplateSavingNotification class with multiple templates.

    Declaration
    public TemplateSavingNotification(IEnumerable<ITemplate> target, EventMessages messages)
    Parameters
    Type Name Description
    IEnumerable<ITemplate> target

    The templates being saved.

    EventMessages messages

    The event messages collection.

    View Source

    TemplateSavingNotification(IEnumerable<ITemplate>, EventMessages, bool, string)

    Initializes a new instance of the TemplateSavingNotification

    Declaration
    public TemplateSavingNotification(IEnumerable<ITemplate> target, EventMessages messages, bool createTemplateForContentType, string contentTypeAlias)
    Parameters
    Type Name Description
    IEnumerable<ITemplate> target

    Gets a enumeration of the ITemplate.

    EventMessages messages

    Initializes a new instance of the EventMessages.

    bool createTemplateForContentType

    Boolean value determining if the template is created for a Document Type. It's not recommended to change this value.

    string contentTypeAlias

    This is the alias of the ContentType the template is for. This is used when creating a Document Type with Template. It's not recommended to try and change or set this.

    View Source

    TemplateSavingNotification(ITemplate, EventMessages)

    Initializes a new instance of the TemplateSavingNotification class with a single template.

    Declaration
    public TemplateSavingNotification(ITemplate target, EventMessages messages)
    Parameters
    Type Name Description
    ITemplate target

    The template being saved.

    EventMessages messages

    The event messages collection.

    View Source

    TemplateSavingNotification(ITemplate, EventMessages, bool, string)

    Initializes a new instance of the TemplateSavingNotification

    Declaration
    public TemplateSavingNotification(ITemplate target, EventMessages messages, bool createTemplateForContentType, string contentTypeAlias)
    Parameters
    Type Name Description
    ITemplate target

    Initializes a new instance of the ITemplate.

    EventMessages messages

    Initializes a new instance of the EventMessages.

    bool createTemplateForContentType

    Boolean value determining if the template is created for a Document Type. It's not recommended to change this value.

    string contentTypeAlias

    This is the alias of the ContentType the template is for. This is used when creating a Document Type with Template. It's not recommended to try and change or set this.

    Properties

    View Source

    ContentTypeAlias

    Gets or sets the alias of the content type the template is for.

    Declaration
    public string? ContentTypeAlias { get; set; }
    Property Value
    Type Description
    string
    Remarks

    This is used when creating a document type with a template. It is not recommended to change or set this value.

    View Source

    CreateTemplateForContentType

    Gets or sets a value indicating whether the template is being created for a content type.

    Declaration
    public bool CreateTemplateForContentType { get; set; }
    Property Value
    Type Description
    bool
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX