# Menu Navigation

**URL:** <https://forums.plex.tv/t/menu-navigation/15511>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [March 8, 2012, 5:08pm UTC](https://forums.plex.tv/t/menu-navigation/15511 "2012-03-08T17:08:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![KeefTM](https://avatars.discourse-cdn.com/v4/letter/k/ad7895/32.png) [@KeefTM](https://forums.plex.tv/u/KeefTM)\
**Post date:** [March 8, 2012, 5:08pm UTC](https://forums.plex.tv/t/menu-navigation/15511/1 "2012-03-08T17:08:59Z")

</div>

Hello, I’m looking for some help in writing my first plugin. I can’t seem to find anything on programmatic menu navigation. Basically I have it so that the menu function checks to see if the user can or is logged in. If not I want to send the user back to the parent menu. This is possible, right? Thanks!

---

<div class="post-metadata">

**Author:** ![philomini](https://avatars.discourse-cdn.com/v4/letter/p/ecc23a/32.png) [@philomini](https://forums.plex.tv/u/philomini)\
**Post date:** [March 19, 2012, 7:25pm UTC](https://forums.plex.tv/t/menu-navigation/15511/2 "2012-03-19T19:25:11Z")

</div>

Something like this:  
  
  
  
def MainMenu():  
  
oc = ObjectContainer(  
  
title1 = ‘Menu’)  
  
  
  
oc.add(DirectoryObject(  
  
key = Callback(OtherMenu),  
  
title = ‘Other Menu’)  
  
return oc  
  
  
  
def OtherMenu():  
  
if login\_ok():  
  
oc = ObjectContainer(title1 = ‘Other Menu’)  
  
oc.add (…)  
  
else:  
  
oc = MainMenu()  
  
return oc  
  
  
  
will probably work (assuming you define the login\_ok() function and add something to the menu after that check). There are some some attributes you can add to the ObjectContainer to alter whether failed logins affect your stack of menus or not.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 9:52pm UTC](https://forums.plex.tv/t/menu-navigation/15511/3 "2019-12-20T21:52:11Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
