Skip to content

Navigation

lord-willard edited this page Dec 30, 2024 · 2 revisions

How does it work

Jumping from one page to another page is achieved by use of the internal command page.

  "command": "${page:other}"

Navigation can be controlled at page or prompt level. If no navigation is assigned to a prompt, then when selected it will default to the navigation defined at page level.

Implementation

In the example below, the user will be presented with pages to select. Upon selecting page_one the user will be navigated to Page One, similar for page_two. If the user selects page_other, the user will be navigated to Page Default.

{
  "pages": [
    {
      "name": "main",
      "label": "Main",
      "command": "${page:default}",
      "prompts": [
        {
          "label": "Select Page One",
          "name": "page_one",
          "command": "${page:one}"
        },
        {
          "label": "Select Page Two",
          "name": "page_two",
          "command": "${page:two}"
        },
        {
          "label": "Select Page Other",
          "name": "page_other"
        }
      ]
    },
    {
      "name": "Page One",
      "label": "one"
    },
    {
      "name": "Page Two",
      "label": "two"
    },
    {
      "name": "Page Default",
      "label": "default"
    }
  ]
}

Clone this wiki locally