rw.pages

The following template example will output the page (and folder) details for all the pages in a project.

@each(page in pages)
    {{page.title}}
    {{page.isPublished}}
    {{page.displayInMenu}}
    {{page.url}}
    {{page.isActive}}
    {{page.isExternalPage}}
    {{page.pageDepth}}
    {{page.openInNewWindow}}
    {{page.icon}}
    {{page.hasPages}}
    {{page.hasActiveChild}}

    @each(childpage in page.pages) 
        {{childpage.title}} 
    @endeach
@endeach

Before you can access the page properties you'll need to include the following code in the Hooks.js

const transformHook = (rw) => {    
    // Get pages from rw
    const pages = rw.pages
    
    // Set pages in our template data
    rw.setProps({ 
        pages
    })
}

exports.transformHook = transformHook;

Last updated

We are Realmac Software. We make nice things.