- ⌂ io_comand_publication
- Configurations
- Content Types
Publication Content Type
The Publication content type is used configure a publication, which is used to publish a set of Publication Procedures to a destination.
It is a best practice to extend the Publication content type for each unique publication for a number of reasons explained further below. For example, add a "Company Website" content type that extends the "Publication" content type, which will be used to configure the staging and production publication for the company website.
Fields
General
- Title - The name of the Publication (ie. "Company Website - Production")
- Content Folders - The Publication will typically look in this folder and its child folders recursively for content.
- Publication Procedures - The Publication Procedures to publish to the destination.
- Active - A checkbox to determine if this Publication is active and should be published automatically when scheduled, and when Publish/Preview buttons are manually clicked in Content Manager.
Destination
- Publish Path - The file system folder to publish files to, including the trailing slash. This may be a local folder path (ie. /publications/www.website.com/htdocs/) or an FTP/SFTP URL including the remote folder path (ie. sftp://ftp.hostname.com/publications/www.website.com/htdocs/).
- Publish Jail - Optional file system folder that files should not be able to be written outside of. If specified, the Publish Path must be under the Publish Jail.
- Username - Optional username to be filled in when the Publish Path contains an FTP/SFTP URL that requires authentication.
- Password - Optional password to be filled in when the Publish Path contains an FTP/SFTP URL that requires authentication.
- URL - The URL where the published files will be accessed on the web (ie. http://www.website.com/).
Processing
- Identifier - Name of the Publication, as it will be referenced in scripts (e.g. #LINK).
- Run As - The user the publication will be processed as. If not set, the user that invoked the runnable (e.g. Scheduled Task User) will be used. The publication user's authorizations will be respected, so the selected user may impact the content available during the publish process.
- URL Processor - The URL Processor to use for this publication, which impacts the outcome of #LINK/#OUTPUT paths and provides an alternative algorithm for deriving these. Provide the fully qualified class name (including namespace and leading \) of the class to process URLs with. If not specified, this will provide the default URL processing functionality for publishing. A common built-in option is: \io_comand_publication\url_processors\remove_index
- Last Published - Time this publication was last published.
- Last Attempted - Time the system last attempted to publish this publication.
Settings
- Is Staging - Check if this represents a staging version of the publication (ie. a preview website) that can be used to test updates in a staging environment before publishing to a production environment. Do not check if this represents a production version of the publication (ie. the public website). If checked, this publication will be published from a Preview button in Content Manager. If unchecked, this publication will be published from a Publish button in Content Manager.
Extending Publications
It is a best practice to extend the Publication content type for each unique publication for a number of reasons explained below.
Fields (Publication Variables)
Custom variables can be added to a Publication by extending the Publication content type with custom fields. This is useful for differentiating one related Publication (e.g. production, staging and development) from another. All Publication fields are available as cTemplate Publication Variables to all Publication Procedures when they are published.
Methods (Publication Methods)
Each content type that extends Publication can be associated with the following cTemplate or PHP Methods.
- Published - Called each time a Publication has finished publishing. It receives an associative array of files that were published where the key is the Publication Procedure DOID and the value is an associative array where either (a) the key is the Object DOID for each published object in the Publication List results, if the publication procedure has a Publication List and the value is (b), or (b) the key is the file path of all published files, published by the Publication Procedure directly and any #OUTPUT() directives referenced in its Filename or Script and the value is an associative array with the key/value pairs of: url (full URL to the published file), size (size of the file in bytes) and modified (TRUE if the file was modified).
- PublishedProcedure - Called each time a Publication Procedure with no Publication List has finished publishing. It receives two parameters: the Publication Procedure and the published files as an associative array where the key is the filename and the value is an associative array with the key/value pairs of: url (full URL to the published file), size (size of the file in bytes) and modified (TRUE if the file was modified).
- PublishedObject - Called each time a Publication Procedure with a Publication List has finished publishing a Publication List result object. It receives three parameters: the Publication Procedure, the Publication List Object and the published files as an associative array where the key is the filename and the value is an associative array with the key/value pairs of: url (full URL to the published file), size (size of the file in bytes) and modified (TRUE if the file was modified).