Contribute to Docs Contribute to Docs

Page Picker

Methods

Open

piranha.pagepicker.open(callback, siteId = null);

Parameters

Callback

The callback function is called when a page is selected in the page picker. The provided function should accept one parameter which will be the selected page object. Let's take a look how it could look if we selected an page from page picker.

{
    id: "a16eb9ee-1c3f-4b04-b223-5a8f2b655f63",
    siteId: "f376a89d-230e-4eee-8b02-78b8ff83e693",
    title: "About us",
    typeName: "Content Page",
    published: "2019-10-17",
    status: "",
    editUrl: "manager/page/edit/",
    isCopy: false,
    isDraft: false,
    isExpanded: true,
    permalink: "/about-us",
    items:[]
}

The method can easily be called with either an inline callback or by providing a previously defined function:

piranha.pagepicker.open(function (page) {
    console.log(page);
});
SiteId

If no siteId is passed the default site will be loaded.