Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add nav-links for custom pages #1645

Closed
ajayvishwanath opened this issue Sep 3, 2015 · 7 comments
Closed

Add nav-links for custom pages #1645

ajayvishwanath opened this issue Sep 3, 2015 · 7 comments

Comments

@ajayvishwanath
Copy link

I have gotten around to understand some of the basic ways to configure keystone. For example, creating models, adding routes, middleware and changing which columns appear in Admin UI. They all work pretty smooth. :)

However, what has been bugging me for the past few days is that I am able to create my custom routes and templates but unable to provide any "links" to those routes, either in the homepage or the header navigation. The header navigation allows you to add only keystone lists.

How do I add a non-keystone list in my navigation panel (say an About Us page) and at the same time have the Admin UI enabled for the keystone lists?

@creynders
Copy link
Contributor

Hi @ajayvishwanath you can add any links you want to the navigation by adding an object instead of a string:

keystone.set( "nav", {
  "content": [
    "posts",
    "post-categories",
    "enquiries",
    {
      label: "reports",
      key: "reports",
      path: "/api/reports"
    },
  ]
});

@ajayvishwanath
Copy link
Author

Hey, thanks for the reply!

I tried and it works pretty well. Thanks.

@r3wt
Copy link

r3wt commented May 18, 2016

this no longer works. whats the new way to work around this issue?

@ifiok
Copy link

ifiok commented Nov 13, 2016

@r3wt Did you find a workaround for this?

@alexandrecardinal
Copy link

alexandrecardinal commented Dec 28, 2016

@r3wt @ifiok I just found a workaround

keystone.set('nav', {
	venues: 'venues',
	customers: 'customers',
	users: 'users',
	'reservations': [
		{
			label: 'Reservations',
			key: 'reservations',
			path: '/reservations'
		}
	]
});

In this case, this will give me a menu item called 'Reservations' leading me to '/reservations'. You HAVE to wrap your menu item with an array... this is probably a bug that should be fixed at some point.

@zoltanradics
Copy link

@r3wt I have a question

The menu configuration is clear. It works for me. My question is how can i put a custom admin page template behind the route without going out of /keystone admin.

For example i want to create a "/keystone/dashboard" page but obviously there is no schema or model for the dashboard as i want to display custom information, which can not be strictly connected to one resource.

Does anyone know how to do that?

@alexandrecardinal
Copy link

alexandrecardinal commented Jan 6, 2017

@zoltanradics I really doubt you can do that without modifying the keystonejs module. I did some research and it seems doable in v4.0.0 but not the in v0.3.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants