Skip to content
Grav 2.0 is officially stable. Read the announcement →
Archive

Navigation - how to?

Started by Muut Archive 11 years ago · 2 replies · 463 views
11 years ago

Would there be a possibility to set navigation through grav admin panel?

Like - to mark selected page in settings to display it in menu.
Also adding external links easy.

These are the problems I'm facing, and probably not only me, and would like the simple solution to it.

11 years ago

Basically any page that is visible will potentially show up in the menu. Also pages that have a numeric-folder prefix that defines order, are visible unless configured not to be. So basically you can build your navigation through the admin by just creating your pages, and setting which are visible and which are not.

Currently the only way to add external links is to add them via the theme templates directly.

You can however, add a page in Grav, make it visible and then set the redirect header option so that it redirects to an external URL.

11 years ago

Depending on the theme you're using, you can also add to user/config/site.yaml a menu param:

YAML
menu:
  -
    url: 'http://test.com'
    text: Test

Antimatter, Afterburner2, Bootstrap and Striped work out of the box, you can inspect their partials/navigation.html.twig if yours does not.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1345 9 years ago
Archive · by Muut Archive, 9 years ago
2 932 9 years ago
Archive · by Muut Archive, 9 years ago
2 4059 9 years ago
Archive · by Muut Archive, 9 years ago
1 2945 9 years ago
Archive · by Muut Archive, 9 years ago
3 1117 9 years ago