Hide Dashboard Page from Menu

Permalink 1 user found helpful
I have a package that uses a number of single pages in the dashboard. There are 3 pages in each section, which shows up in the drop-down menu in the dashboard. However, there are a few pages that I do NOT want to show up on this menu.

How do I prevent any single page from being visible in a dashboard menu?

View Replies: View Best Answer
jimic79 replied on at Permalink Best Answer Reply
Not sure if you've figured this out or not, but I just found that all you have to do is go to the Site Map and add the Exclude from Nav attribute to the page. You can do this programmatically as well when you add the page during install:

$p = Page::getByPath('/dashboard/yourpackage/package-page', $version = 'RECENT');
$p->setAttribute('exclude_nav', 1);