Hi guys does anyone know how I might go about creating a dynamic navigation using a global with the navigation items as fields, is this even possible?
Global is not really the best option for dynamic navigation, because by definition it is designed to contain just one of something — and while it supports multiple fields, it only supports one instance of each field. Technically you could use a field within the global that supports multiple items (i.e.
table fieldtype or
matrix fieldtype), but none of the fieldTypes support hierarchical structures natively, so I don't see the advantage. Or you could simply paste static HTML into a text field, but I wouldn't really classify that as dynamic. Overall, not a particularly good option.
You should probably be looking into using a 'structure' (or to a lesser extent 'categoryGroup'), where each entry would represent a page or nav item, organized hierarchically. In this way you can reuse the same field within each entry (i.e. 'title') and loop through the entries to dynamically generate the nav, with the added benefit of being able to reorganize the nav easily using drag-and-drop.
For more information, see: