PageAPI Tool - Documentation topics on: htmlpageapi,.

PageAPI Tool

The PageAPI Tool Velocity viewtool provides methods to check the status and permissions of pages, and load page references (objects or identifiers) for specific pages.



$pageAPI.canUserPublish(pageId, true)BooleanReturns true if the current user has permissions to publish the page with the specified pageId.
Note: The second parameter is a boolean value that must be passed for backward compatibility, but does not affect the operation of the method.
$pageAPI.hasContent(page, container)BooleanReturns true if content has been added to the specified container on the specified page.
$pageAPI.loadPageByPath(path, host)HTMLPageReturns the HTMLPage object for the page specified by the path and host.
$pageAPI.loadPageIdentifier(path, host)StringReturns the Identifier of the page specified by the path and host.


pageIdStringRequiredThe identifier or inode of a page (returned either by the loadPageIdentifier() method or via other Velocity code).
pageHTMLPage objectRequiredAn object representing a page (returned either by the loadPageByPath() method or via other Velocity code).
containerContainer objectRequiredAn object representing a container (returned via other Velocity code).
pathStringRequiredA path in the dotCMS folder structure.
hostStringRequiredThe name of a dotCMS Host.


Example: Determine if any content has been added to a page

Toolbox.xml Configuration

The Import Tool is enabled by default in dotCMS. To ensure the Import Tool is enabled, verify that the following lines exist in your toolbox.xml file:



For more information on this viewtool, please see the following documentation in the dotCMS Javadocs: