Skip to main content
Skip table of contents

Page

Placeholder for accessing page related data.

Methods

NameTypeDescription
absoluteLinkString

The absolute link to this object.

ancestorsList<Page>

The list of ancestors of the content. Can be used to display bread crumbs. The list starts with the very first ancestor and ends with the parent of this content.


In case of blog posts the ancestors are represented by the overview placeholders for all blog posts, a year's blog posts and a month's blog posts.


authorString

The username of the user who created this content. May be null if there is no author (e.g. on a search result or error page).

(warning) Deprecation Notice: Use creator.username instead.

canCommentboolean

True, if the current user has permission to comment on this content.

canEditboolean

True if the current user has the required permissions to edit this content object, otherwise false.

canViewboolean

True if the current user has the required permissions to view this content object, otherwise false.

categoriesAsHtml()String

A list of the categories of the page, formatted in this style: "label1, label2, label3 and label4", where each label is an HTML anchor tag with href="#".

childrenList<Page>

All sorted children the current user is allowed to view.

commentsList<Comment>

A list of all comments on the content object (in chronologically ascending order, i.e. oldest first).

contentString

The content of this content object, rendered using the default page layout and no macro overrides but the defaults and the ones found in the overrides directory of the theme.

creationDateDate

The date when this content has been originally created.

creationDate(pattern)String

The date when this content has been created originally, formatted using the given pattern.

ParameterTypeDescription
patternStringA datetime pattern as described in the Joda DateTime API specification.
creationDate(pattern, locale)String

The date when this content has been created originally, formatted using the given pattern and locale key.

ParameterTypeDescription
patternStringA datetime pattern as described in the Joda DateTime API specification.
localeStringA locale key like "en" or "de_DE".
creatorUser

The user who created the content. May be null if there is no creator (e.g. on a search result or error page).

creatorNameString

The username of the user who created this content. May be null if there is no creator (e.g. on a search result or error page).

(warning) Deprecation Notice: Use creator.username instead.

descriptionString

The first 140 characters of the content, rendered using the default macro overrides and the ones found in the overrides directory of the theme.

editUrlString

An absolute URL to the edit page.

excerptString

The full excerpt of the page, if defined, rendered using the default macro overrides and the ones found in the overrides directory of the theme.

excerptAsHtmlString

The excerpt as HTML code, rendered using the default macro overrides and the ones found in the overrides directory of the theme.

fromConfluenceAbstractPage

The Confluence page or blog post object.

getDescription(macroOverrides)String

The first 140 characters of the content, rendered using the default macro overrides, the ones found in the overrides directory of the theme, and the ones specified in macroOverrides.

ParameterTypeDescription
macroOverridesMap<String,String>A mapping of macro names to paths of templates to be used as an override for the corresponding macro.
getDescription(maxLength)String

The first maxLength characters of the content, rendered using the default macro overrides and the ones found in the overrides directory of the theme.

ParameterTypeDescription
maxLengthintThe maximum length of the returned description.
getDescription(maxLength, macroOverrides)String

The first maxLength characters of the content, rendered using the default macro overrides, the ones found in the overrides directory of the theme, and the ones specified in macroOverrides.

ParameterTypeDescription
maxLengthintThe maximum length of the returned description.
macroOverridesMap<String,String>A mapping of macro names to paths of templates to be used as an override for the corresponding macro.
getExcerpt(macroOverrides)String

The full excerpt of the page, if defined, rendered using the default macro overrides, the ones found in the overrides directory of the theme, and the ones specified in macroOverrides.

ParameterTypeDescription
macroOverridesMap<String,String>A mapping of macro names to paths of templates to be used as an override for the corresponding macro.
getExcerpt(maxLength)String

The excerpt of the content, if defined, cut off after maxLength characters and rendered using the default macro overrides and the ones found in the overrides directory of the theme.

ParameterTypeDescription
maxLengthintThe maximum length of the returned excerpt.
getExcerpt(maxLength, macroOverrides)String

The excerpt of the content, if defined, cut off after maxLength characters and rendered using the default macro overrides, the ones found in the overrides directory of the theme, and the ones specified in macroOverrides.

ParameterTypeDescription
maxLengthintThe maximum length of the returned excerpt.
macroOverridesMap<String,String>A mapping of macro names to paths of templates to be used as an override for the corresponding macro.
getExcerptAsHtml(macroOverrides)String

The excerpt as HTML code, rendered using the default macro overrides, the ones found in the overrides directory of the theme, and the ones specified in macroOverrides.

ParameterTypeDescription
macroOverridesMap<String,String>A mapping of macro names to paths of templates to be used as an override for the corresponding macro.
hasChildrenboolean

True if this content has children, otherwise false.

idString

The ID of the content, the pattern and semantics of this ID are implementation-specific.

isAncestor(otherPage)boolean

True if the current page is an ancestor of the {@code otherPage}.

ParameterTypeDescription
otherPagePage
labelsLabelList

The labels of the content.

lastModificationDateDate

The date when this content was last modified.

lastModificationDate(pattern)String

The date when this content was last modified, formatted using the given pattern.

ParameterTypeDescription
patternStringA datetime pattern as described in the Joda DateTime API specification.
lastModificationDate(pattern, locale)String

The date when this content was last modified, formatted using the given pattern and locale key.

ParameterTypeDescription
patternStringA datetime pattern as described in the Joda DateTime API specification.
localeStringA locale key like "en" or "de_DE".
lastModifierUser

The user who last modified the content. May be null if there is no last modifier (e.g. on a search result or error page).

lastModifierNameString

The username of the last user who modified this content. May be null if there is no last modifier (e.g. on a search result or error page).

(warning) Deprecation Notice: Use lastModifier.username instead.

linkString

The relative link to this object.

nextPage

The next content in the page hierarchy.


In case of pages, it returns the next page in the page tree (prefix order). In case of blog posts, it returns the blog posts chronologically succeeding this one.


parentPage

The parent page of the current page. Will be unset for the home page of a space. For blog posts this returns the month overview, for month overviews the year overview, and for year overviews an overview of all blog posts.

prevPage

The previous content in the hierarchy.


In case of pages, it returns the previous page in the page tree (prefix order). In case of blog posts, it returns the blog post chronologically preceding this one.


propertiesPageProperties

The page properties of the content.

renderContent()String

The content of this content object, rendered using the default page layout and no macro overrides but the defaults and the ones found in the overrides directory of the theme.

renderContent(pageLayout)String

The content of this content object, rendered using the specified page layout and no macro overrides but the defaults and the ones found in the overrides directory of the theme.

ParameterTypeDescription
pageLayoutStringThe path to a template that should be used to render the page layouts.
renderContent(pageLayout, macroOverrides)String

The content of this content object, rendered using the specified page layout, the macro overrides found in the overrides directory, and the overrides specified in macroOverrides.

ParameterTypeDescription
pageLayoutStringThe path to a template that should be used to render the page layouts.
macroOverridesMap<String,String>A mapping of macro names to paths of templates to be used as an override for the corresponding macro.
resourcesWebResources

Include web resources.

Returns: HTML tags to include Confluence resources, such as CSS and JavaScript files.

spaceKeyString

The key of the space this content is located in.

titleString

The title of this content.

topLevelCommentsList<Comment>

A list of all top-level comments on content object (in chronologically ascending order, i.e. oldest first). This can be used to display threaded comments.

typeString

The type of the content object. Possible values:

  • page
  • blogpost
  • blog-overview
  • confluence-abstract-page


JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.