Menus

Unfold CMS includes a flexible menu builder for creating and managing navigation menus. Menus support multiple levels of nesting, different item types, and drag-and-drop reordering.

Overview

The menu system allows you to:

  • Create unlimited menus for different site locations (header, footer, sidebar)
  • Add multiple item types — pages, posts, categories, custom URLs
  • Build nested menus with parent-child relationships
  • Drag and drop to reorder items
  • Assign menus to template locations defined by your active template

Managing Menus

Creating a Menu

Navigate to Menus in the admin panel and click Create Menu.

Field Description
Name Display name for the menu (e.g., "Main Navigation")
Location Where the menu appears in the template (e.g., "header", "footer")

Template locations are defined in your template's configuration. Common locations include:

Location Description
header Primary navigation in the site header
footer Footer navigation links
sidebar Sidebar navigation widget
mobile Mobile-specific navigation

Each location can have one menu assigned to it at a time.

Item Types

Type Description Example
Page Links to a CMS page About, Contact
Post Links to a blog post Featured article
Category Links to a category archive Technology, News
Custom URL Links to any URL External site, anchor link

Adding Items

  1. Open a menu for editing
  2. Select the item type from the available panels
  3. Choose the specific page, post, or category (or enter a custom URL)
  4. Set a display label (defaults to the item's title)
  5. Click Add to Menu

Nesting Items

To create dropdown/sub-menus, drag an item underneath and to the right of another item. The menu builder supports multiple levels of nesting:

Home
About
  └── Our Team
  └── History
Blog
  └── Technology
  └── Design
Contact

Reordering

Drag and drop items to change their order. Both the position within a level and the nesting hierarchy can be changed by dragging.

Template Integration

Displaying Menus

In your Blade templates, use the menu helper to render navigation:

{{-- Get menu by location --}}
@php
    $menu = menu('header');
@endphp

@if($menu)
<nav>
    <ul>
        @foreach($menu->items as $item)
        <li>
            <a href="{{ $item->url }}">{{ $item->label }}</a>
            @if($item->children->count())
            <ul>
                @foreach($item->children as $child)
                <li><a href="{{ $child->url }}">{{ $child->label }}</a></li>
                @endforeach
            </ul>
            @endif
        </li>
        @endforeach
    </ul>
</nav>
@endif

Each menu item provides:

Property Type Description
label string Display text
url string Full URL for the link
target string Link target (_self, _blank)
parent_id int/null Parent item ID for nesting
order int Sort order within its level
children collection Nested child items

Sample Data

When installing with sample data, the following menus are created:

Header Menu:

  • Home
  • Blog
  • About
  • Contact

Footer Menu:

  • Privacy Policy
  • Terms of Service
  • Contact

You can modify or delete these menus after installation.

Permissions

Operation Required Role
View menus Editor or higher
Create menus Editor or higher
Edit menus Editor or higher
Delete menus Admin or higher
Assign to locations Admin or higher