<p>Do you mean have multiple tabbed content within your plugin admin area? If so yes that's possible you just need to add a tabs array in your template like so:</p>

<pre><code>{% set tabs = {
 tab1: { label: "Tab 1"|t, url: url('plugin') },
 tab2: { label: "Tab 2"|t, url: url('plugin/tab2') },
} %}
</code></pre>

<p>Then to make a tab active in the navigation you would just add this to the relevant template:</p>

<pre><code>{% set selectedTab = 'tab2' %}
</code></pre>

<p>If you are referring to having both <code>clients</code> and <code>newsletter</code> in the top navigation I don't think so, I think it's one section per plugin (but I could be mistaken)</p>

<p><strong>Edit</strong></p>

<p>Sorry I should have elaborated, you will also need to register additional pages in your main plugin class, like so:</p>

<pre><code>public function registerCpRoutes()
{
  return array(
    'pluginHandle/some-page' =&gt; 'pluginHandle/_someTemplate'
  );
}
</code></pre>

<p><a href="http://buildwithcraft.com/docs/plugins/templates#extending-the-cp-layout" rel="nofollow">There is a bunch of info about this in the plugin docs</a></p>

CC BY-SA 3.0
2015-06-03T14:55:06.050Z
2015-06-03T15:06:57.733Z
2015-06-03T15:06:57.733Z
Alec Ritson
<p>The top links in the CP header are often called <em>nav tabs</em>.</p>

<p>Beyond the "default" nav tab for your plugin (pointing to the plugin's <a href="https://docs.craftcms.com/v2/plugins/templates.html#giving-your-plugin-its-own-cp-section" rel="nofollow noreferrer">CP section</a>), it's possible to declare additional tabs via the <a href="http://buildwithcraft.com/docs/plugins/hooks-reference#modifyCpNav" rel="nofollow noreferrer">modifyCpNav</a> hook (added in <a href="https://github.com/craftcms/cms/blob/master-v2/CHANGELOG-v2.md#232640---2015-03-12" rel="nofollow noreferrer">Craft 2.3.2640</a>):</p>

<pre><code>public function modifyCpNav(&amp;$nav)
{
    $nav['mypluginhandle-newsletter'] = array('label' =&gt; 'Newsletter', 'url' =&gt; 'mypluginhandle/newsletter');
}
</code></pre>

<p>Of course, this will only create a tab with a link pointing to whatever you put in the <code>url</code> property. If you haven't already created the page for the newsletter, you'll need to do so by creating a <a href="http://buildwithcraft.com/docs/routing" rel="nofollow noreferrer">route</a> to a template or controller:</p>

<pre><code>public function registerCpRoutes()
{
    return array(
        'mypluginhandle/newsletter' =&gt; 'myPluginHandle/newsletter',
    );
}
</code></pre>

<p>Read more about the <code>registerCpRoutes</code> hook in the <a href="https://docs.craftcms.com/v2/plugins/hooks-reference.html#registercproutes" rel="nofollow noreferrer">official docs</a>.</p>

<p>Both the <code>modifyCpNav()</code> and <code>registerCpRoutes()</code> methods should go in your plugin's main class.</p>

CC BY-SA 3.0
2015-06-03T19:40:20.490Z
Well, you learn something new everyday!
Alec Ritson
CC BY-SA 4.0
2015-06-03T18:16:04.193Z
2018-10-22T10:28:51.927Z
2018-10-22T10:28:51.927Z
Mats Mikkel Rummelhoff
<p>Is it possible to add another link to admin navigation? For example I have plugin clients which has it's own Button in the admin menu, in the same plugin i have newsletter so I would like to have that Newsletter in that menu as well.</p>

<plugin-development><navigation><admin><craft-pro>
Can plugin have two links in admin navigation?
# Can plugin have two links in admin navigation?

(Asked by: username_0 on 2015-06-03)

Is it possible to add another link to admin navigation? For example I have plugin clients which has it's own Button in the admin menu, in the same plugin i have newsletter so I would like to have that Newsletter in that menu as well.

**Tags:** plugin-development, navigation, admin, craft-pro

---

## 2 answers

### Answer by username_2 on 2015-06-03. Score: 6 | Accepted answer

The top links in the CP header are often called nav tabs.
Beyond the "default" nav tab for your plugin (pointing to the plugin's CP section), it's possible to declare additional tabs via the modifyCpNav hook (added in Craft 2.3.2640):
public function modifyCpNav(&$nav)
{
    $nav['mypluginhandle-newsletter'] = array('label' => 'Newsletter', 'url' => 'mypluginhandle/newsletter');
}

Of course, this will only create a tab with a link pointing to whatever you put in the url property. If you haven't already created the page for the newsletter, you'll need to do so by creating a route to a template or controller:
public function registerCpRoutes()
{
    return array(
        'mypluginhandle/newsletter' => 'myPluginHandle/newsletter',
    );
}

Read more about the registerCpRoutes hook in the official docs.
Both the modifyCpNav() and registerCpRoutes() methods should go in your plugin's main class.

> **Comments:**
> **username_1**: Well, you learn something new everyday!  

---

### Answer by username_1 on 2015-06-03. Score: 3

Do you mean have multiple tabbed content within your plugin admin area? If so yes that's possible you just need to add a tabs array in your template like so:
{% set tabs = {
 tab1: { label: "Tab 1"|t, url: url('plugin') },
 tab2: { label: "Tab 2"|t, url: url('plugin/tab2') },
} %}

Then to make a tab active in the navigation you would just add this to the relevant template:
{% set selectedTab = 'tab2' %}

If you are referring to having both clients and newsletter in the top navigation I don't think so, I think it's one section per plugin (but I could be mistaken)
Edit
Sorry I should have elaborated, you will also need to register additional pages in your main plugin class, like so:
public function registerCpRoutes()
{
  return array(
    'pluginHandle/some-page' => 'pluginHandle/_someTemplate'
  );
}

There is a bunch of info about this in the plugin docs


---

