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
- Rendering Menus in Code: render a menu from a widget shortcode, layout XML, or a phtml template.
Building Custom Menu Components
- Creating Custom Menu Components: the
hyva_menu_rootcontext 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_componentsandmax_nesting_level. - Category Tree Expander: use the built-in
hyva_menu_category_treecomponent, or build your own with theCategoryTreeExpanderview model. - Locking Menus in Preview Mode: make a custom menu stay open in the Hyvä CMS editor preview, including nested menus.
Related Topics
- 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.