# Manager control panel

Keywords:

When managers log in to the Gamerz IS, they see a control panel (CP).

It’s a list of links for tasks that managers need to do. BTW, “control panel” isn’t an official Drupal term, just something that makes sense to people.

You can try it. Go to the login page. (https://gamerz.cybercour.se/user/login) Log in with the user name manager, and the password password. You won’t be able to change the data, but otherwise, you’ll see what managers see.

# What is it, really?

The CP isn’t a new type of thing. It’s just a block with a menu in it. That’s all.

Why not call it a menu, if that’s what it is?

Ruben
Having a special name makes it easier to talk about in training and documentation. You can say “Find the link in the control panel that…” and people will know what you mean.

The CP is part of the mental model we give managers. They act as if the CP is a special thing. We know that it’s really a menu in a block, but that doesn’t matter to them.

# Making the CP

• When editing a page
• In views
• Manually

## When editing a page

You’ve been doing this for a while now. When you edit a page, you can tell Drupal to make a menu item for it. You’ve been adding pages to the main menu. To add a page to the CP, select that menu:

However, you won’t see the menu on the list, unless you’ve configured the content type to allow it.

So, if you don’t see the menu you want in the list, check whether the content type allows it.

Here’s the CP again:

There aren’t any links to pages in the CP, so we won’t need to make any. If we had, say, a Basic page with instructions for managers, we’d put a link to the page in the CP.

Half of the links in the CP are links to views. Here they are, marked with bacon:

One problem is that some of the views have links in two menus. Manage projects, for example, has a link in the main menu, and in the CP. Views can only have one menu item at a time. For those links, and for links that aren’t for views, you need to make the links manually.

You need to tell Drupal the text for the link, and the URL. Let’s add the Add person link. The text is “Add person”. To find the URL, go to the page you would use to add a person. In the admin menu, click Content, then Add content, then Person. You’ll see the usual page for adding content of type Person:

Look at the URL. That tells you the URL you need for the Add person link in the CP. Type it in:

Don’t type in the domain, but do remember to include the leading /. Oh, and select the right menu for the Parent.

There’s another way to find the URL to use for a menu link. Take Logout. There are logout links on other menus. If I find one, I can put the mouse cursor on the link, and see the destination in the browser:

The URL is /user/logout.

When you create a menu, Drupal automatically creates a block for it. You show the menu by showing the block.

Go to Structure | Block layout. Find the region you want to add the menu block to, and click Place block.

Choose the block to place. Then configure it to show only to the right roles:

# Exercise

Make a control panel for your gamerz site, like the one on the sample site.

Make sure it only shows up for managers.

Submit the URL of your site, and the login credentials for user 1.

(If you were logged in as a student, you could submit an exercise solution, and get some feedback.)