Create a free account to get access to additional free training videos. Enjoy this free video from CraftQuest! Create a free account to get access to additional free training videos. Join the Community

Creating Navigation in Craft CMS

Global-Set-Powered Navigation

In this example, we create a Global Set in Craft and use it to build and manage the site navigation. The advantage here is that it allows someone, presumably the client or customer, to manage the navigation from the Craft control panel. This is helpful in some scenarios because it doesn't require the intervention of a developer or technical staff member.

In this exam­ple, we cre­ate a Glob­al Set in Craft and use it to build and man­age the site nav­i­ga­tion. The advan­tage here is that it allows some­one, pre­sum­ably the client or cus­tomer, to man­age the nav­i­ga­tion from the Craft con­trol pan­el. This is help­ful in some sce­nar­ios because it doesn’t require the inter­ven­tion of a devel­op­er or tech­ni­cal staff member.

This imple­men­ta­tion has the down­side of strad­dling sta­t­ic and ful­ly dynam­ic nav­i­ga­tion, with lim­it­ed con­trol over child nav­i­ga­tion items (like the drop-down we did in the Par­tial­ly-Dynam­ic ver­sion above).

We can han­dle this nav­i­ga­tion in a few ways because we can use any field or field type in a Glob­al Set. For this ver­sion, let’s use a Table field and man­age all nav­i­ga­tion items as table rows. 

Creating Navigation in Craft CMS is made up of the following videos: