Skip to content

Unpublish

Unpublishes the document from all previously published folders and returns the current document instance.

1
myDocument.Unpublish():Document

Unpublishes the document from the specified folders and returns the current document instance.

1
myDocument.Unpublish(folderPath: string):Document

Parameters

string folderPath
    The path of the folder(s) to unpublish the document from.

Returns

The current Document instance.

Remarks

This method changes the Document.State property to "Draft" and saves the document.
If folderPath is specified, the document is removed from the specified folders. The path can be specified as a full path. Non-existing folders are ignored.

Example

1
2
3
4
var existingDocument = $Documents.Get(id);

// Unpublishing the document under Test\Documents folder path:
existingDocument.Unpublish('Test\Documents');

See Also