Available Data

Access Project Properties

Properties from the current environment can be used within templates but most of them need to be passed through using the setProps command in the hooks.js file first. The node object is always available.

const transformHook = (rw) => {    
    // Expose project, page and component objects to the template, node is always available
    rw.setProps({
        project: rw.project,
        page: rw.page,
        component: rw.component
    })
}

exports.transformHook = transformHook;

With this in place, we gain access to the following within template files.

Project Properties

Property Name
Type
Description

{{project.title}}

String

{{project.mode}}

String

{{project.siteURL}}

String

{{project.language}}

String

{{project.enableSocialTags}}

Boolean

{{project.allowDarkMode}}

Boolean

{{project.logo.url}}

String

{{project.logo.alt}}

String

Page Properties

Property Name
Type
Description

{{page.id}}

String

{{page.title}}

String

{{page.menuTitle}}

String

{{page.filename}}

String

{{page.ext}}

String

{{page.language}}

String

{{page.absolutePath}}

String

{{page.docRootPath}}

String

{{page.projectResourcesPath}}

String

Path to the project resources

{{page.isFolder}}

Boolean

Does this page represent a folder

{{page.displayInMenu}}

Boolean

Should the page be shown in menus

{{page.isDraft}}

Boolean

Draft pages are not published

{{page.icon.url}}

String

Path to the page icon

Node Properties

The node object is always passed into templates and contains the following properties.

Property Name
Type
Description

{{node.id}}

String

{{node.title}}

String

{{node.parent.id}}

String

{{node.parent.container}}

String

{{node.backendPath}}

String

Path to the node's backend folder.

Component Properties

Property Name
Type
Description

{{component.title}}

String

{{component.group}}

String

{{component.version}}

Integer

{{component.build}}

Integer

{{component.assetPath}}

String

Path to component assets

{{component.siteAssetPath}}

String

Path to component site assets

{{component.sharedAssetPath}}

String

Path to pack shared assets

Last updated

Was this helpful?