App (config.js)
While sipa.json configures the project and its build tooling, the application itself is configured in app/config/config.js.
This file is created for you when you run sipa new, and it is executed when your app starts. It calls SipaPage.setConfig to define application-wide defaults like the layout and the navigation behavior.
app/config/config.js
SipaPage.setConfig({
/* default layout for all pages */
default_layout: 'default',
/* specific layouts for some pages { <page-name>: <layout-name> } */
default_layouts: {
// 'login-page': 'mini-dialog'
},
/* keep URL anchor when loading another page */
keep_anchor: false,
/* keep query params when loading another page */
keep_params: true,
/* use jQuery cache: true/false.
When disabled, jQuery adds a ?_=<number> parameter on page and layout
requests to avoid browser caching. */
cache_page_layout_requests: false,
/* preserve <link> and <script> children tags of the body on layout loading.
Useful when you inject scripts or stylesheets on the body dynamically. */
preserve_script_link_tags: true,
});
Options
default_layout: the layout applied to all pages unless overwritten. See Create a new layout for how layouts work.default_layouts: a map of{ page-name: layout-name }to apply specific layouts to specific pages.keep_anchor: whether the URL anchor is kept when navigating to another page. Defaultfalse. See Navigation & URL handling.keep_params: whether the query parameters are kept when navigating to another page. Defaulttrue. See Navigation & URL handling.cache_page_layout_requests: whether page and layout requests may be cached by the browser. Whenfalse, a cache busting parameter is added to each request.preserve_script_link_tags: whether<link>and<script>tags injected into the body are preserved when a layout is loaded.
Mobile
For mobile projects based on OnsenUI, the application is configured with SipaOnsenPage.setConfig instead. It works analogously.