Class PageAPI
Extends
ContentObjectAPI, TagContainerAPI
Page object information can be extended using the default REST-API.
options:
- update: true
Whether the page should be locked in the backend when loading it.
default: true
- template: true
Whether the template information should be embedded in the page object.
default: true
- folder: true,
Whether the folder information should be embedded in the page object.
default: true
WARNING: do not turn this option off - it will leave the API in a broken
state.
- langvars: false,
When the language variants shall be embedded in the page response.
default: false
- workflow: false,
When the workflow information shall be embedded in the page response.
default: false
- pagevars: false,
When the page variants shall be embedded in the page response. Page
variants will contain folder information.
default: false
- translationstatus: false
Will return information on the page's translation status.
default: false.
Defined in: page.js.
Constructor Attributes | Constructor Name and Description |
---|---|
PageAPI()
|
Field Attributes | Field Name and Description |
---|---|
<static> |
PageAPI.WRITEABLE_PROPS
|
Method Attributes | Method Name and Description |
---|---|
<static> |
PageAPI.createTag(construct, success, error)
Creates a tag of a given tagtype in this page.
|
<static> |
PageAPI.preview(success, error)
|
<static> |
PageAPI.publish(success, error)
|
<static> |
PageAPI.removeTag()
|
<static> |
PageAPI.removeTags()
|
<static> |
PageAPI.takeOffline(success, error)
|
<static> |
PageAPI.template(success, error)
Get this page's template.
|
<static> |
PageAPI.unlock(success, error)
|
- keyword to create a tag based on the construct with given keyword
- constructId to create a tag based on the construct with given ID
- sourcePageId and sourceTagname to create a tag as copy of the given tag from the page
createTag('link', onSuccess, onError);or
createTag({keyword: 'link', magicValue: 'http://www.gentics.com'}, onSuccess, onError);or
createTag({sourcePageId: 4711, sourceTagname: 'link'}, onSuccess, onError);
- Parameters:
- {string|number|object} construct
- either the keyword of the construct, or the ID of the construct
or an object with the following properties
- keyword keyword of the construct
- constructId ID of the construct
- magicValue magic value to be filled into the tag
- sourcePageId source page id
- sourceTagname source tag name
- {function(TagAPI)=} success
- Optional callback that will receive the newly created tag as its only argument.
- {function(GCNError):boolean=} error
- Optional custom error handler.
- Throws:
- INVALID_ARGUMENTS
- Returns:
- {TagAPI} The newly created tag.
- Parameters:
- success
- error
- Parameters:
- success
- error
- Parameters:
- success
- error
- Parameters:
- {funtion(TemplateAPI)=} success
- Optional callback to receive a TemplateAPI object as the only argument.
- {function(GCNError):boolean=} error
- Optional custom error handler.
- Returns:
- {TemplateAPI} This page's parent template.
- Parameters:
- success
- error