Answers.Body: <p>When you generate Craft CMS plugin and module code scaffolding on <a href="https://pluginfactory.io/" rel="nofollow noreferrer">https://pluginfactory.io/</a> please turn on switch for CP section and then your plugin path/src/.php file in change $hasCpSection true.</p>
  <p>Once you do the above changes your plugin will display on the nav bar.  I think this will solve your problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-30T11:21:11.607Z
Answers.LastActivityDate: 2020-12-30T11:21:11.607Z
Answers.UserDisplayName: ZealousWeb
Answers.Body: <p>You need to use the <a href="https://craftcms.com/docs/3.x/extend/cp-section.html" rel="nofollow noreferrer">EVENT_REGISTER_CP_NAV_ITEMS</a> event in the main plugin class. From the docs:</p>
  <pre><code>use craft\events\RegisterCpNavItemsEvent;
  use craft\web\twig\variables\Cp;
  use yii\base\Event;
  
  public function init()
  {
      parent::init();
  
      Event::on(
          Cp::class,
          Cp::EVENT_REGISTER_CP_NAV_ITEMS,
          function(RegisterCpNavItemsEvent $event) {
              $event-&gt;navItems[] = [
                  'url' =&gt; 'section-url',
                  'label' =&gt; 'Section Label',
                  'icon' =&gt; '@mynamespace/path/to/icon.svg',
              ];
          }
      );
  
      // ...
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-12-30T13:04:57.483Z
Answers.LastActivityDate: 2020-12-30T13:04:57.483Z
Answers.UserDisplayName: dmatthams
Body: <p>I want to control my plugin on the admin navbar but I can't found a way for that.</p>
  
Tags: <plugin-development><craft3>
Title: Custom plugin settings add on admin nav bar
ThreadText: # Custom plugin settings add on admin nav bar
  
  (Asked by: username_0 on 2020-12-30)
  
  I want to control my plugin on the admin navbar but I can't found a way for that.
  
  **Tags:** plugin-development, craft3
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2020-12-30. Score: 0 | Accepted answer
  
  When you generate Craft CMS plugin and module code scaffolding on <https://pluginfactory.io/> please turn on switch for CP section and then your plugin path/src/.php file in change $hasCpSection true.
  
  Once you do the above changes your plugin will display on the nav bar.  I think this will solve your problem.
  
  
  ---
  
  ### Answer by username_2 on 2020-12-30. Score: 2
  
  You need to use the [EVENT\_REGISTER\_CP\_NAV\_ITEMS](https://craftcms.com/docs/3.x/extend/cp-section.html) event in the main plugin class. From the docs:
  
  ```
  use craft\events\RegisterCpNavItemsEvent;
  use craft\web\twig\variables\Cp;
  use yii\base\Event;
  
  public function init()
  {
      parent::init();
  
      Event::on(
          Cp::class,
          Cp::EVENT_REGISTER_CP_NAV_ITEMS,
          function(RegisterCpNavItemsEvent $event) {
              $event->navItems[] = [
                  'url' => 'section-url',
                  'label' => 'Section Label',
                  'icon' => '@mynamespace/path/to/icon.svg',
              ];
          }
      );
  
      // ...
  }
  
  ```
  
  
  ---
  
  