Orphan Page Functions
In This Topic
In XperienCentral it is possible to create orphan pages. Orphan pages are pages without a parent. The pageService
offers two methods for working with orphan pages. One method creates a new orphan page and another method moves a page to the orphan pages section. Orphan pages do not appear in the navigation tree of a website. Pages like "Contact", "Help" and "Search" are typical examples of orphan pages. Unlike all pages underneath the homepage, the pages in the root of the orphan pages subtree in the Site Structure Widget can not be ordered.
Create a New Orphan Page
To create a new orphan page, use the method createOrphanPage
. This method returns the newly created orphan page. It takes one argument:
based on page
- the page the orphan is based on (the settings for workflow, page sections, design template, and so forth).
The following code example shows how to create a new orphan page based on the settings for the homepage:
Page homepage = mySession.getXperienCentralApplication().getWebsites()[0].getHomePage(); Page newOrphanPage = myPageService.createOrphanPage(homepage);
Move a Page to the Orphan Pages Subtree
To move a page to the Orphan Pages subtree, use the method moveToOrphanPages
. This method returns a boolean which indicates whether the move was successful. The method takes one argument: the name of the page to be moved to the Orphan Pages subtree. For example:
Page homepage = mySession.getXperienCentralApplication().getWebsites()[0].getHomePage(); Page newPage1 = myPageService.createAndInsertPage(homepage); if (!myPageService.moveToOrphanPages(newPage1)) { LOG.severe("Failed to move page: " + newPage1 + " to orphan pages."); }