Front-End JavaScript APIs

There are JavaScript APIs available that you may want to interact with:

Pagedip Metadata

To get metadata for the current Pagedip and page, use window.pd.get(). This will return an object containing:

page

The current page's metadata.

_id

The page's ID

title

The page's title.

path

The page's path.

order

The order in which the page is displayed in the document flow and table of contents.

options

The theme options for this page.

pagedip

The current Pagedip's metadata.

guid

The Pagedip's unique identifier

title

The Pagedip's title.

handle

The Pagedip's URL handle.

owner

The owner of the Pagedip.

options

The Pagedip's theme options.

db_url

The database URL for the current Pagedip, used for communication with the Pagedip API.

baseUrl

The curent Pagedip's base URL.

In the Pagedip Writeroom

When working in the Pagedip Writeroom, no JavaScript will be executed. Any interactive elements or functionality in the theme that requires JavaScript will not be active until viewed live.