---
title: Shortcuts
---

# Shortcuts

<div class="documentation__toc"></div>

## Introduction

Shortcuts are notification type indicators that also support dropdown menus.

### Defining Shortcuts

Shortcuts are defined on your `module` similar to sections.

```php
protected $shortcuts = [
    'settings' => [
        [
            'icon' => 'fa fa-cogs',
            'href' => '/admin/settings',
        ]
    ]
];
```

You can also set the dynamically using a handler.

```php
<?php namespace Anomaly\SettingsModule;

use Anomaly\Streams\Platform\Addon\Module\ModuleCollection;
use Anomaly\Streams\Platform\Ui\ControlPanel\ControlPanelBuilder;

class SettingsModuleShortcuts
{

    public function handle(ControlPanelBuilder $builder, ModuleCollection $modules)
    {
        if (!$module = $modules->active()) {
            return;
        }

        if (!$module->hasAnyConfig(['settings', 'settings/settings'])) {
            return;
        }

        $builder->addShortcut(
            'settings',
            [
                'icon' => 'cogs',
                'href' => 'admin/settings/modules/' . $module->getNamespace(),
            ]
        );
    }
}
```
