Skip to content

Subpages, sidebars and windows

Henrik Vendelbo edited this page Jun 25, 2013 · 6 revisions

body contents in separate page

<body src="/pages/default-layout.html">

By adding a src or data-src attribute to the body element additional content will be appended to the body. Alternate subpages can be switched in and out of the body element. Before switching to another you should call loadPage to have the contents ready.

When a different subpage is loaded in the body the old body elements are pushed into the old subpage. This means that if you switch back and forth you will get the content back as it was before you switched.

Before the sub-page is loaded existing elements are marked with permanent = true. This means that when a sub-page is unapplied the original elements remain.

Loaded pages

Subordinate page sources are loaded in Resolver("page::pages"). This can be done by configuration using

<script type="application/config">
loadPage("/pages/default-layout.html");
</script>

If you want to load a page into a document level element such as article,section,aside you can do so using role application, complimentary, main, dialog. In the config set the src.

<script type="application/config">
declare("main-stage",{
  "src": "/pages/default-layout.html"
});
</script>

The benefits of using subpages is that roles and layouters can be configured within the subpage.

Note that subpage loading is different from the element it is used in. This allows subpages to be used in multiple elements.

Opening a tool window

 defineWindow()

The tool window should have the meta tag track main if you want the tool window to be glued to the main window. When opened the tool window page resolver will have state.managed = true.

Clone this wiki locally