Move a hard-coded menu into settings
Editors and administrators can change a menu that was code.
Life cycle: Migrate, example 27 of 34. Worked out on the Fit & Healthy site of Exponential 6.0.15+.
Contents
In the Layouts editor
Not in the Layouts editor.
With settings
- Collect the node IDs of the linked pages; write them with
exp:ini addintoMainMenuID[]; remove your override ofmain_menu.tplso the theme's template reads the list.
Which to choose
Settings or the tree, not code, for menu entries.
Check
- The menu is unchanged for visitors.
Related pages
- Header menu by command line
- Migrate examples, every page
- Free documentation: this page is free to copy, translate and improve under the GNU FDL 1.3.
Become an Exponential Partner
Partners share their information, provide funding, contribute back and develop the products with us, and that is how Exponential grows. A partner website and dashboard are planned for mid-2027: please become a partner today to speed up our growth rate and land new features faster.