Search Results for

    Show / Hide Table of Contents
    View Source

    Class Template

    Represents a Template file.

    Inheritance
    object
    BeingDirtyBase
    EntityBase
    File
    Namespace: Umbraco.Cms.Core.Models
    Assembly: Umbraco.Core.dll
    Syntax
    [Serializable]
    [DataContract(IsReference = true)]
    public class Template : File, ITemplate, IFile, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty

    Constructors

    View Source

    Template(IShortStringHelper, string?, string?)

    Declaration
    public Template(IShortStringHelper shortStringHelper, string? name, string? alias)
    Parameters
    Type Name Description
    IShortStringHelper shortStringHelper
    string name
    string alias
    View Source

    Template(IShortStringHelper, string?, string?, Func<File, string?>?)

    Declaration
    public Template(IShortStringHelper shortStringHelper, string? name, string? alias, Func<File, string?>? getFileContent)
    Parameters
    Type Name Description
    IShortStringHelper shortStringHelper
    string name
    string alias
    Func<File, string> getFileContent

    Properties

    View Source

    Alias

    Gets the Alias of the File, which is the name without the extension

    Declaration
    [DataMember]
    public string Alias { get; set; }
    Property Value
    Type Description
    string
    View Source

    IsMasterTemplate

    Returns true if the template is used as a layout for other templates (i.e. it has 'children')

    Declaration
    public bool IsMasterTemplate { get; set; }
    Property Value
    Type Description
    bool
    View Source

    MasterTemplateAlias

    returns the master template alias

    Declaration
    public string? MasterTemplateAlias { get; set; }
    Property Value
    Type Description
    string
    View Source

    MasterTemplateId

    Declaration
    [DataMember]
    public Lazy<int>? MasterTemplateId { get; set; }
    Property Value
    Type Description
    Lazy<int>
    View Source

    Name

    Gets the Name of the File including extension

    Declaration
    [DataMember]
    public string? Name { get; set; }
    Property Value
    Type Description
    string

    Methods

    View Source

    DeepCloneNameAndAlias(File)

    Declaration
    protected override void DeepCloneNameAndAlias(File clone)
    Parameters
    Type Name Description
    File clone
    View Source

    SetMasterTemplate(ITemplate?)

    Set the mastertemplate

    Declaration
    [Obsolete("MasterTemplate is now calculated from the content. This will be removed in Umbraco 15.")]
    public void SetMasterTemplate(ITemplate? masterTemplate)
    Parameters
    Type Name Description
    ITemplate masterTemplate
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX