Documentation > CMS Template API Library > OutputContext

CrownPeak.CMSAPI.OutputContext : CrownPeak.CMSAPI.Context

The context available when running the output template file Also available when running filename.aspx, url.aspx, assetfilename.aspx, and asseturl.aspx

NameDescriptionType
DisableAutoDependencyGeneration

Gets or sets a value indicating whether to automatically generate dependencies. Use in conjuction with Asset.AddDependencyTo to manually control dependency links. Defaults to false.

Property
DisablePreviewCache

Set this to true if you want to disable the preview render cache for this asset. Does not affect publishing. It is recommended you keep the default value of false.

Property
IsGeneratingDependencies

Gets or sets a value indicating whether to generate dependencies. Defaults to true.

Property
IsPublishing

Gets a value indicating whether the currently running template file is part of a publishing process.

Property
LayoutName

Name of the layout file such as output.aspx or xml_output.aspx.

Property
LocalPath

The path of the published file on the CMS Readonly: asset.Move() and/or asset.Rename() can be used to change the path.

Property
PageNumber

The current page number for a paginated asset. Will be zero for non-paginated assets.

Property
PropertiesExtension

Extension extracted from the filename on the publishing properties page

Property
PropertiesFilename

The filename on the publishing properties page

Property
PropertiesFolder

The folder from the Publishing properties page

Property
PublishAgain

Use to cause the publish loop to run one more time. Use PublishingLoopNumber to see which iteration you are currently on. The limit is 100 iterations. This is independent of pagination when using Util.Paginate() in that case the publishing loop will continue for the necessary number of pages and this property will be false.

Property
PublishingArgs

Gets the publishing args. Use HasArgs property to see if args are available. Use dictionary notation [] to access specific values.

Property
PublishingLoopNumber

The current publishing loop number. Usually the same as page number, but it always starts at 1. Goes hand-in-hand with "PublishAgain". Use this to see which iteration you are on if you are using PublishAgain to continue publishing.

Property
PublishingPackage

The destination package.

Property
PublishingStatus

The status that corresponds to the current publishing destination.

Property
PublishPath

Current value of the publish Path (the ftp filename relative to the root). Used in the actual transfer of a file to the server. It can be overridden in filename.aspx or assetfilename.aspx. WARNING: This value is not populated and has no effect in url.aspx and asseturl.aspx

Property
PublishUrl

Current value of the publish URL (relative). It can be overridden in url.aspx or asseturl.aspx. The URL is used to generate links to an asset or other resource. PublishUrl must sometimes may generated independently of the filename depending on how the server is setup. WARNING: This value is not populated and has no effect in filename.aspx and assetfilename.aspx

Property
RelativeFolder

The path to the folder that contains the asset relative to where the asset's deployment properties are found. For example, if an asset is in /Site/About Us and it's deployment properties are on the Site folder, the value would be "About Us".

Property
RemoteHostname

FTP Hostname where the file is being published

Property
RemotePath

The path of the published file on the server Readonly: Setting context.PublishPath in filename.aspx or assetfilename.aspx can be used to change the value of the file path. Publishing Properties can also be set for this purpose.

Property
RemoteUsername

Username used to connect to the remote FTP host.

Property
UserVariables

A place to store data as key value pairs to retrieve later. Can be shared when calling other templates with Asset.Show, Asset.GetLink, and by a Wrapper as long as all templates involved are C#.

Property
ClientName

The name of this client.

Property
CultureInfo

If this is set, then when asset objects are looking for fields via the [] operator, they will first look for the the culture string (fr for example) plus name before returning, otherwise the field without the string will be returned. This will remain set for the lifetime of the currently running template unless specifically set to another culture or to null which will restore the default. The default culture has a string of "en-US"

Property
CurrentTemplateId

The asset id of the template file that we are currently running.

Property
Error

Contains errors. May also be used to trigger or set an error under some circumstances such as during upload.aspx During post_input don't use this for validation errors, use ValidationError instead.

Property
ExecutedById

The asset id of the asset that is executing this template. Only populated if the current template is called by another such as when using an Asset.Show() or Asset.GetLink() command. Calling template must also be a C# template.

Property
FilterStatus

Contains the names of statuses like "Live" and "Stage" which are considered valid in the current context. There is usually always a blank "" which signifies that assets without workflow are valid. Affects all calls which use filter status including Asset.Load(), Asset.GetFilterList(), Asset.GetFileList(), and Asset.GetFolderList() unless specifically set by those functions. This is a ReadOnlyCollection. You may read it, but not modify it. Reading this type of collection is almost identical to reading a List.

Property
JobId

The job id if the current template is running via a Job. Currently only used by post_save_job template.

Property
Language

The short form value of the User's selected language

Property
UIType

The type of user interface from which the current user is running the template. UIType.Unspecified is used when publishing.

Property
UserInfo

Gets the user info. See the User class note on this one.

Property

Connect with Crownpeak