Available Data

Access data in your transform hook

The rw object passed to your transform hook provides access to various data sources. Most data needs to be passed to templates using rw.setProps(), except for node which is always available.

Quick Reference

Property
Description

UI control values from properties.json

Responsive property values by breakpoint

Component collections data

Project-level settings

Current page information

Component instance data (always available in templates)

Component metadata and asset paths

Theme configuration including breakpoints

Site navigation page tree

Basic Example

const transformHook = (rw) => {
    // Access various data sources
    const { title, isVisible } = rw.props;
    const { items } = rw.collections;
    const { mode } = rw.project;
    const { id } = rw.node;
    const { assetPath } = rw.component;
    
    // Pass to templates
    rw.setProps({
        title,
        isVisible,
        items,
        isEditMode: mode === 'edit',
        nodeId: id,
        iconPath: `${assetPath}/icons/`
    });
};

exports.transformHook = transformHook;

Exposing Data to Templates

While the node object is automatically available, other data must be explicitly passed:

With this in place, you can access properties in your templates:

Data Availability by Mode

Some data may differ between edit and preview modes:

Last updated

Was this helpful?