Home › How do I…? › How to add a page to the menu

How to add a page to the menu

Advanced Framework Pro's menu is data-driven: a page is a widget plus a PDA_WidgetPage data asset listed on the pawn's BPC_Pawn_Menu. One entry adds the page to the menu on every platform. By the end of this you will have a new page in the main menu, in VR, on desktop and on mobile.

At a glance

Your page widget           parent WBP_Base
DA_WidgetPage_<Name>       PDA_WidgetPage: Widget = your widget class, Button = label + icon
Your pawn
└─ BPC_Pawn_Menu           Pages += DA_WidgetPage_<Name>   (the menu, every platform)
└─ BPC_Pawn_Sidebar        Pages += DA_WidgetPage_<Name>   (optional: the desktop sidebar)

Steps

  1. Create a widget deriving from WBP_Base for your page content.
  2. Create a PDA_WidgetPage data asset. Set Widget to your widget class and fill in Button with the label and icon.
  3. Open your pawn and find its BPC_Pawn_Menu component.
  4. Add an entry to Pages and reference your new page data asset.
The page data asset
howto_menupage_01.pngThe page data asset
The page data asset
The page in the VR menu
AFS_UI_Menu_vr.pngThe page in the VR menu
The page in the VR menu

Notes

Because the page is referenced by data asset rather than by the menu widget, the same page appears in WBP_Menu on every platform without further work. To show it in the desktop sidebar (WBP_Sidebar) as well, add the same entry to the pawn's BPC_Pawn_Sidebar.