Hello everyone! Today, we’re going to be creating custom menu items in Grav.
Custom menu items give you the ability to quickly and easily add links to your site’s navigation menu that go beyond your site’s pages and into external resources.
Link to your social media pages, other websites you manage, or even to a GitHub or GitLink content repository containing the content of your Grav site. The choice is yours.
The most common method for achieving this is through creating a redirect page within your site.
Let’s get started! Step 1: Create a Redirect Page Even though we’re linking our new menu item to an external page, we still have to create what’s referred to as a Redirect Page which tells Grav that an item should appear in the site menu, and where that item should go.
Step 1: Create a Page
Step 2: Add the Redirect
The next step in the process involves adding the redirect to the page. Here is the simplest method:
Select the Advanced tab. Scroll down to Overrides and locate the Page Redirect field. Enter the URL you would like the menu item to go to in the field. Select Save.
That’s it! We’ve created a new menu item that goes directly to your URL of choice.
There are other ways to achieve the same effect, including manually entering the redirect override in Expert mode or using your text editor of choice. Some themes also have easy-to-configure fields that enable you to add custom menu items along with icons without having to create pages at all.
And that wraps up at our brief look at creating custom menus in Grav!
Notice an error? Think you can improve this documentation? Edit this Page