PHPackages                             dft/silverstripe-custommenus - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dft/silverstripe-custommenus

ActiveSilverstripe-vendormodule[Utility &amp; Helpers](/categories/utility)

dft/silverstripe-custommenus
============================

A Silverstripe module allowing you to create custom menus that can be gernated in the front end of your site.

2.1.6(3y ago)18346131BSD-3-ClausePHPCI failing

Since Nov 12Pushed 10mo ago6 watchersCompare

[ Source](https://github.com/Dean-Forest-Tech/silverstripe-custommenus)[ Packagist](https://packagist.org/packages/dft/silverstripe-custommenus)[ Docs](http://github.com/i-lateral/silverstripe-custommenus)[ RSS](/packages/dft-silverstripe-custommenus/feed)WikiDiscussions 2 Synced 1mo ago

READMEChangelogDependencies (8)Versions (18)Used By (1)

Custom Menus
============

[](#custom-menus)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/fdd8a2c532b89e6a80f4f71cd12200486ffbfec92c5309a6e252716bd634b238/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4465616e2d466f726573742d546563682f73696c7665727374726970652d637573746f6d6d656e75732f6261646765732f7175616c6974792d73636f72652e706e673f623d32)](https://scrutinizer-ci.com/g/Dean-Forest-Tech/silverstripe-custommenus/?branch=2)[![Code Intelligence Status](https://camo.githubusercontent.com/d5563662e25e55832e5d94fb0b36db3f00e5ea752e7af26953505d00ddb058ee/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f4465616e2d466f726573742d546563682f73696c7665727374726970652d637573746f6d6d656e75732f6261646765732f636f64652d696e74656c6c6967656e63652e7376673f623d32)](https://scrutinizer-ci.com/code-intelligence)[![Build Status](https://camo.githubusercontent.com/b760477c7e772bee482d1108b97cf2c9d378783c64e8491fe8d42e39cb9d0834/68747470733a2f2f7472617669732d63692e6f72672f4465616e2d466f726573742d546563682f73696c7665727374726970652d637573746f6d6d656e75732e7376673f6272616e63683d32)](https://travis-ci.org/Dean-Forest-Tech/silverstripe-custommenus)

A module to allow the creation of customised menus for your SilverStripe site/App via SiteConfig.

Requirements
------------

[](#requirements)

SilverStripe 4 or 5

Installation Instructions
-------------------------

[](#installation-instructions)

The prefered way to install this module is via composer:

```
composer require dft/silverstripe-custommenus

```

Alternativley you can download the module:

1. Download and add the module to the "custommenus" folder in your SilverStripe root folder
2. Run dev/build?flush=all

Usage
-----

[](#usage)

Once the module is downloaded and installed, you can create menus and add pages to them by visiting:

```
http://www.yourwebsite.com/admin/settings

```

And then clicking on the "Menus" tab.

You will then need to create a `MenuHolder` (or use one of the installed defaults).

Now edit the `MenuHolder` and set the BaseClass (this will usually default to `SiteTree`). Once you have done this **and saved** you will be able to associate this menu item with you Page/Object using the ObjectID field.

Templates
---------

[](#templates)

`CustomMenus` comes with two options for rendering menus into a template you can either:

### Use the bundled template

[](#use-the-bundled-template)

Adding `$RenderedCustomMenu(menu-slug)` to your template code make use of the CustomMenu.ss include to render a UL (with a unique class name).

You can also overload this template in your own theme to generate custom HTML for your navigation.

You can also enable the Title of the menu in the template by calling:

`$RenderedCustomMenu(menu-slug, true)`

### Loop through a list of menu items

[](#loop-through-a-list-of-menu-items)

Alternativley you can generate your own template by adding the following code:

```

                    $MenuTitle

```

### Access to the base `CustomMenuHolder`

[](#access-to-the-base-custommenuholder)

When rendering the menu into a template, you can access the base holder using the `$Holder` variable, from the example above you can use:

```

        $Holder.Title

                    $MenuTitle

```

Linking to custom DataObjects
-----------------------------

[](#linking-to-custom-dataobjects)

By default this module looks for (and utilises) the CMS module (allowing linking to Pages). It is fairly easy though to add links to other DataObjects though.

### DataObject Requirements

[](#dataobject-requirements)

First off, ensure that your custom `DataObject` has the following methods available:

- Link
- AbsoluteLink
- RelativeLink

Also, ensure the following properties are available:

- Title
- MenuTitle

### Add `DataObject` class

[](#add-dataobject-class)

Now, you need to make `CustomMenuLink` aware of this class. You can do that by adding it (and a description) to your config.yml:

```
CustomMenuLink:
  base_classes:
    "SiteTree": "Page on site"
    "Product": "A Product"

```

**NOTE** You MUST ensure that any data object you want to add to a menu has a defined `searchable_fields` config variable.

### Customising assotiations

[](#customising-assotiations)

Sometimes using the default fields for an object can cause issues (maybe you want to search only MenuTitle for a page, for example).

You can customise how your linked classes are loaded via the following additional config:

```
CustomMenuLink:
  base_classes:
    'SilverStripe\CMS\Model\SiteTree':
      Title: 'A Page' # Name for this object in the CMS
      Label: 'Title' # The title field used when displaying t he assotiation in the CMS
      SearchFields: # Fields used to search for an assotiated object
        - Title
        - URLSegment
        - StockID

```

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity72

Established project with proven stability

 Bus Factor1

Top contributor holds 89.5% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~271 days

Recently: every ~578 days

Total

15

Last Release

322d ago

Major Versions

1.2.0 → 2.0.02018-01-19

1.3.1 → 2.1.02018-02-14

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7d4998767cb41bf0048a65158559384fbab33751b26c996d6367019c68c4f8b?d=identicon)[DFT](/maintainers/DFT)

---

Top Contributors

[![mlewis-everley](https://avatars.githubusercontent.com/u/687143?v=4)](https://github.com/mlewis-everley "mlewis-everley (102 commits)")[![Makreig](https://avatars.githubusercontent.com/u/6011781?v=4)](https://github.com/Makreig "Makreig (5 commits)")[![sunnysideup](https://avatars.githubusercontent.com/u/167154?v=4)](https://github.com/sunnysideup "sunnysideup (3 commits)")[![nfauchelle](https://avatars.githubusercontent.com/u/1188162?v=4)](https://github.com/nfauchelle "nfauchelle (2 commits)")[![henrypenny](https://avatars.githubusercontent.com/u/2068880?v=4)](https://github.com/henrypenny "henrypenny (1 commits)")[![Juanitou](https://avatars.githubusercontent.com/u/807463?v=4)](https://github.com/Juanitou "Juanitou (1 commits)")

---

Tags

silverstripenavigationmenusnav

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/dft-silverstripe-custommenus/health.svg)

```
[![Health](https://phpackages.com/badges/dft-silverstripe-custommenus/health.svg)](https://phpackages.com/packages/dft-silverstripe-custommenus)
```

###  Alternatives

[nwidart/laravel-menus

Laravel Menu management

168180.3k10](/packages/nwidart-laravel-menus)[silverstripe/userforms

UserForms enables CMS users to create dynamic forms via a drag and drop interface and without getting involved in any PHP code

1321.0M72](/packages/silverstripe-userforms)[pingpong/menus

Laravel Menus

70194.4k13](/packages/pingpong-menus)[rinvex/laravel-menus

Rinvex Menus is a simple menu builder package for Laravel, that supports hierarchical structure, ordering, and styling with full flexibility using presenters for easy styling and custom structure of menu rendering.

294.0k20](/packages/rinvex-laravel-menus)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
