Skip to main content
Skip table of contents

Page

Placeholder for accessing page related data.

Methods

Name

Type

Description

absoluteLink

String

The absolute link to this object.

ancestors

List<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.

author

String

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.

canComment

boolean

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

canEdit

boolean

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

canView

boolean

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="#".

children

List<Page>

All sorted children the current user is allowed to view.

comments

List<Comment>

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

content

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.

creationDate

Date

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.

creationDate(pattern, locale)

String

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

  • Parameter: locale

  • Type: String

  • Description: A locale key like "en" or "de_DE".

creator

User

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

creatorName

String

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.

description

String

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

editUrl

String

An absolute URL to the edit page.

excerpt

String

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.

excerptAsHtml

String

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

fromConfluence

AbstractPage

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.

  • Parameter: macroOverrides

  • Type: Map<String,String>

  • Description: 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.

  • Parameter: maxLength

  • Type: int

  • Description: The 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.

  • Parameter: maxLength

  • Type: int

  • Description: The maximum length of the returned description.

  • Parameter: macroOverrides

  • Type: Map<String,String>

  • Description: 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.

  • Parameter: macroOverrides

  • Type: Map<String,String>

  • Description: 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.

  • Parameter: maxLength

  • Type: int

  • Description: The 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.

  • Parameter: maxLength

  • Type: int

  • Description: The maximum length of the returned excerpt.

  • Parameter: macroOverrides

  • Type: Map<String,String>

  • Description: 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.

  • Parameter: macroOverrides

  • Type: Map<String,String>

  • Description: A mapping of macro names to paths of templates to be used as an override for the corresponding macro.

hasChildren

boolean

True if this content has children, otherwise false.

id

String

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}.

  • Parameter: otherPage

  • Type: Page

labels

LabelList

The labels of the content.

lastModificationDate

Date

The date when this content was last modified.

lastModificationDate(pattern)

String

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

lastModificationDate(pattern, locale)

String

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

  • Parameter: locale

  • Type: String

  • Description: A locale key like "en" or "de_DE".

lastModifier

User

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).

lastModifierName

String

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.

link

String

The relative link to this object.

next

Page

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.

parent

Page

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.

prev

Page

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.

properties

PageProperties

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.

  • Parameter: pageLayout

  • Type: String

  • Description: The 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.

  • Parameter: pageLayout

  • Type: String

  • Description: The path to a template that should be used to render the page layouts.

  • Parameter: macroOverrides

  • Type: Map<String,String>

  • Description: A mapping of macro names to paths of templates to be used as an override for the corresponding macro.

resources

WebResources

Include web resources.

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

spaceKey

String

The key of the space this content is located in.

title

String

The title of this content.

topLevelComments

List<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.

type

String

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.