webCOMAND

#INCLUDE

Insert the contents of an external file located in the Files folder or at a URL.  Supported URLs may start with http://, https://, ftp://, sftp://.

Prototype

#INCLUDE($path, $error_level = 'Error')

Parameters

  • path - Path or URL to the file to include in one of the following formats.
    • Absolute - '/www.website.com/htdocs/index.html'
    • Relative to Publication - './index.html'
    • Relative to Publication Procedure - 'attachments/test.pdf'
    • HTTP - 'http://username:password@www.google.com/index.html'
    • Secure HTTP - 'https://username:password@www.secure.com/index.html'
    • FTP - 'ftp://username:password@ftp.repository.com/home/user/readme.txt'
    • Secure FTP - 'sftp://username:password@ftp.repository.com/home/user/readme.txt'
  • error_level - Optional error level to report from one of the following options.
    • Error (default) - Display an error indicating why the file could not be included.  This is the default type of reporting and will be used if the second parameter is not specified.
    • Warning - Display a short warning that the file could not be included.
    • Warning+ - Display a warning that the file could not be included, followed by the actual errors, which will be ignored by the publish process, and therefor will not prevent the file from publishing.
    • Note - Display a short note that the file could not be included.
    • Note+ - Display a note that the file could not be included, followed by the actual errors, which will be ignored by the publish process, and therefor will not prevent the file from publishing.
    • None - Do not display any errors or warnings.  All errors will be ignored by the publish process.

Example

Here we will insert the contents of a file from a remote website.

#INCLUDE('http://example.com/page.html', Error)

Related

#INSERT is similar to #INCLUDE, except that it inserts content from within the repository.