Setting plugin subnav to active I have written a plugin that works fine, it has a subnav which i build like so:

public function getCpNavItem()
  {
    $item = parent::getCpNavItem();
    $item['subnav'] = [
      'moderateentries' =&gt; ['label' =&gt; 'Moderate Entries', 'url' =&gt; 'entry-moderator'],
      'notificationmessages' =&gt; ['label' =&gt; 'Messages', 'url' =&gt; 'entry-moderator/notificationmessages'],
      'log' =&gt; ['label' =&gt; 'Log', 'url' =&gt; 'entry-moderator/log'],
    ];
    return $item;
  }


Problem i am having is that i cannot get the left hand nav item to display as active, the only one that has the sel class applied is 'moderateentries', if i click on the second or third nav item, the first one is the one that is displayed as active with the sel css class. where am i going wrong?
Based on the docs and this guide, looks like you'll want to set selectedSubnavItem in your Twig template(s) to whatever the key of your selected subnav item is (moderateentries, notificationmessages, etc).

Alternatively, you could do somthing similar to what Andrew Welch does in his SEOmatic plugin; he sets the selectedSubnavItem variable as a keyed item in a variables array and then right after that renders his plugin template (including that variables array in the render method).