Skip to content

Developer Documentation

Menu Builder is built on the Hyvä CMS component system, so everything you already know about Hyvä CMS components applies to menus. The pages in this chapter cover the two developer tasks that are specific to Menu Builder: rendering a menu from your theme code, and building custom menu components that editors can use in the menu builder.

Rendering Menus

Building Custom Menu Components

  • Creating Custom Menu Components: the hyva_menu_root context flag, accepting child components, and letting a parent component control its children's templates.
  • Importing Categories: add the category importer to a custom component with target_child_components and max_nesting_level.
  • Category Tree Expander: use the built-in hyva_menu_category_tree component, or build your own with the CategoryTreeExpander view model.
  • Locking Menus in Preview Mode: make a custom menu stay open in the Hyvä CMS editor preview, including nested menus.
  • Creating Menus: what editors see in the admin, and the features these developer pages implement.
  • Creating Components: the general Hyvä CMS component guide these pages build on.