My question is similar to the following question that did not have any answers but with a little more detail: http://answers.splunk.com/questions/8037/can-an-app-use-multiple-navigation-menus
Does anyone here know how you can use your custom navigation menu xml file after you created in the manager? All of the docs seems to only mention "default.xml" file as the one to use and edit out. But if default.xml is the only navigation file that an app can use then why would there be an option to create and clone your Navigation UI and select the targeted application?
Thanks for your input Nick!
Yeah the create and clone button is really kind of misleading you to think that you can use other nav menu file in place of default.xml for an app. Also I am not interested in maintaining a bunch of Python code hacks either.
I remember filing a bug a while ago about this -- there's nothing you can do with the cloned or added ones, so I suggested that we remove the ability from Manager to do them. Im pretty sure it's just there because the admin section is pretty generic and unless someone spends the time to special case it everything gets create and clone buttons.
So no, there's nothing you can do with any nav file other than 'default'.
However, it is possible to make your own custom module that reads default.xml.
To do this you would copy AppBar.* out of share/splunk/search_mrsparkle/modules/nav/ and put it in your app
etc/apps/<appname>/appserver/modules/CustomAppBar/*) Rename the Files CustomAppBar.* and change the module names inside the files as well. Then start hacking. 😃
I made a custom AppBar module not long ago because I wanted a simpler nested list structure in the HTML so I could change the menuing behavior and it's a piece of cake.
Unfortunately the 'default.xml' is hardcoded pretty deeply into the python controller that runs the view system and there's no easy way to reach out and get something else.
That is to say you could do it, and you could theoretically customize that module so it could accept the filename of the nav file as a param, but to un-hardcode it the mako template for your module would have to duplicate a lot of view.py and that would get pretty hairy -- it can be very annoying to maintain large amounts of python in a mako template.
(for further reading see
/python-2.6/lib/site-packages/splunk/appserver/mrsparkle/controllers/view.py and start at line 168)
The one big downside to using custom modules right now (besides figuring it all out and maintaining them), is that custom modules packaged in apps have a bug where they dont work when Splunk is running on Windows. But hopefully 4.1.6 will be out too and I believe (hope) that they're fixing this bug.