Class TemplateOnDisk
Represents a Template file that can have its content on disk.
Namespace: Umbraco.Core.Models
Assembly: Umbraco.Core.dll
Syntax
[Serializable]
[DataContract(IsReference = true)]
public class TemplateOnDisk : Template, ITemplate, IFile, IEntity, IDeepCloneable, IRememberBeingDirty, ICanBeDirty
Constructors
View SourceTemplateOnDisk(String, String)
Initializes a new instance of the TemplateOnDisk class.
Declaration
public TemplateOnDisk(string name, string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the template. |
System.String | alias | The alias of the template. |
Properties
View SourceContent
Gets or sets the content.
Declaration
public override string Content { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Getting the content while the template is "on disk" throws, the template must be saved before its content can be retrieved.
Setting the content means it is not "on disk" anymore, and the template becomes (and behaves like) a normal template.
IsOnDisk
Gets or sets a value indicating whether the content is on disk already.
Declaration
public bool IsOnDisk { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |