DialogForge logoDialogForge

Menus & Pages

The structure of a menu file, from the top level keys down to a single button.

A menu is one YAML file under menus/. The file's path without the extension is its id, so menus/staff/reports.yml has the id staff/reports. A menu file also registers its own command, and DialogForge builds and shows a fresh dialog every time a player switches page, so a category and its content are only ever what the file says they are.

The Rules page of the shipped rules menu: five rules as bullet lines with the punishment in red at the end of each, a paragraph about appeals, then the category buttons The Rules, Agree and Appeals, a page button reading I have read these, and a Close button.

Top level keys

command: guide
aliases:
  - wiki
permission-mode: open
title: '<green><bold>Server Guide</bold></green>'
external-title: 'Guide'
default-page: welcome
columns: 2
pages:
  - id: welcome
    ...
KeyWhat it does
commandThe command that opens this menu, registered for you
aliasesExtra names for the same command
permission-modeopen, optional or required. See Permissions
permissionA node of your own instead of the built in one
titleShown at the top of the dialog. %page_label% follows the open category
external-titleThe name shown in /dialogforge list and tab completion
default-pageWhich page opens first
layoutOverrides layout.mode in config.yml for this menu only
columnsCategory buttons per row, stacked layout only
content-widthOverrides panel.content-width for this menu only
backgroundNames a picture declared under backgrounds: in config.yml
close-with-escapeOverrides behaviour.close-with-escape for this menu
override-commandTake a command another plugin already registered
lockHolds a player until an answer on one of this menu's pages says so, see Locks

A page

pages:
  - id: getting-started
    label: 'Getting Started'
    title: '<green><bold>Getting Started</bold></green>'
    icon: '<green>⛏</green> '
    tooltip: 'Your first hour'
    content:
      - '<white>1. Run <dark_green><bold>/island create</bold></dark_green>.</white>'
      - ''
      - '<green>✦</green> <white>Everything you build is protected.</white>'
    items:
      - material: WOODEN_PICKAXE
        name: '<green>Starter kit</green>'
        description: '<white>Claim it once with</white> <dark_green><bold>/kit starter</bold></dark_green>'
KeyWhat it does
idUnique within the menu, used by open_page and by parent
labelThe sidebar text
titleReplaces the menu title while this page is open
iconPut in front of the label, any MiniMessage text or an %icon:name%
tooltipShown on hover in the panel layout
contentOne dialog line per list entry, wrapped for you
itemsSmall item cards drawn inline, see below
buttonsExtra buttons beyond the category grid, see Inputs & actions
inputsText, toggle, slider or dropdown fields, see Inputs & actions
parentDraws this page indented under another page's id, see Subcategories below
permission-mode / permissionLocks this one page rather than the whole menu
hide-when-lockedNever show this page even when layout.show-locked-pages is on
icon-widthOverrides panel.icon-width for this page's icon only
actionsMakes this a shortcut instead of a screen, see below

An items entry takes material, name, description, amount, tooltip, show-tooltip and show-decorations, and is drawn as a small card inline with the content.

That page, as the shipped guide.yml draws it. The page's own title has replaced the menu title at the top, and the item card sits inline after the content:

The Getting Started page of the shipped guide, titled Getting Started rather than Server Guide: a heading reading Your first hour, four numbered steps with the commands in green, two bullet lines about protection, and a wooden pickaxe item card reading Claim it once with /kit starter.

Subcategories

The same sidebar drawn twice: with Island being read, its three subcategories are shown indented underneath it, and with a different category being read, that branch is collapsed to just its own row.

A page names a parent to sit indented underneath it in the sidebar instead of alongside it:

- id: island
  label: 'Island'
  content: [...]

- id: island-level
  parent: island
  label: 'Level'
  content: [...]

A branch only shows while the page being read is somewhere inside it, so a menu of fifty pages reads as a list of ten until the player picks one. layout.always-expand in config.yml draws every branch all the time instead. A parent that does not exist, a ring of parents, or a shortcut used as a parent are all refused when the file is loaded, because each of those would end up as a category nobody could ever draw.

Shortcuts

A page with actions and no content is a shortcut. It sits in the category list like any other page, but clicking it runs the actions instead of opening a screen, and the menu stays exactly where it is:

- id: discord
  label: 'Discord'
  icon: '<blue>💬</blue> '
  tooltip: 'Opens the invite in your browser'
  actions:
    - 'open_url: https://discord.arrowtan.cc'

A page cannot carry both actions and content, and a shortcut cannot be default-page. Both are refused when the menu file is loaded.

The default page

default-page is the id that opens when the menu is opened with no page named, for example running /guide with nothing after it. behaviour.resume-last-page in config.yml reopens a returning player on the page they last had open instead, if it is still one they can see.

Full examples

The five shipped menus cover most of what a menu file can do. guide.yml is a plain public guide with subcategories and a shortcut. rules.yml pairs a confirm page with a lock. settings.yml shows every input type saving a per-player value. staff.yml shows a menu locked with permission-mode: required and a page locked again inside it. faq.yml sets layout: panel on itself, so it is the sidebar menu: questions grouped under topics down the left, the answer beside them, and a button on its last page that is still a real button.

Every one of these ships with the plugin and is meant to be edited or deleted, not kept as-is. menus/guide.yml, rules.yml, settings.yml, staff.yml and faq.yml are on disk after the first start.

On this page