rw.pages

The rw.pages array provides access to the site's navigation structure. This is commonly used for building navigation menus, sitemaps, and breadcrumbs.

Properties

Each page object in the array contains:

Property
Type
Description

title

String

The page title

url

String

Relative URL to the page (e.g., "portfolio/")

description

String

Page description

isPage

Boolean

Whether this is a regular page

isFolder

Boolean

Whether this is a folder

isLink

Boolean

Whether this is an external link

isCode

Boolean

Whether this is a code file

isExternal

Boolean

Whether this links externally

isActive

Boolean

Whether this is the current page

hasActiveChild

Boolean

Whether a child page is active

isDraft

Boolean

Draft pages are not published

displayInMenu

Boolean

Whether to show in navigation

openInNewWindow

Boolean

Whether link opens in new window

navLevel

Number

Navigation depth level (0 = top level)

pageDepth

Number

Depth in page hierarchy

hasPages

Boolean

Whether this page has child pages

pages

Array

Nested array of child pages

icon

Object

Page icon object

Example Structure

Accessing Pages

Filtering for Navigation

Filter pages to only show those meant for navigation:

Building a Navigation Menu

Template for navigation:

Finding the Active Page

Building Breadcrumbs

Checking for Subpages

Last updated

Was this helpful?