Add your own Admin menu options

by Joe Payne 27. January 2008 00:00

Introduction
This one is pretty simple if you already know .Net programming, but not everyone does.

I have a few URL's I like to keep close-at-hand, like my distributors. But I'm not always on my home computer so using My Favorites only works to a point. You can add your own menu options the Admin menu with just a few simple steps. And you don't even have to be a .Net programmer.

In this example, we're going to add a few search engine URLs to the Admin Help menu in AC7.

Always make a backup
First, make a backup copy of the ~/Admin/Menu.Sitemap file just in case something bad happens. Bad things never happen right? Uh huh. Just keep telling yourself that.

Using the right editor
Open the menu.sitemap file located in the ~/Admin/ folder of your site using Notepad. I suggest Notepad specifically because there's no risk of it saving the file in a different format than a text file. That's important - .Net will complain (loudly) if the file format isn't what it expects.

The file will look quite "busy", but it has a very clear pattern once you study it for a short while.

Sitemap file layout
Scroll the menu.sitemap file all the way to the bottom. That's where the Admin Help menu options are located. By now, you may have noticed that the menu entries seem to be stored top-to-bottom in the file exactly how they are listed left-to-right on the Admin screen. The order of the items listed in this file is how .Net determines their display position within the menu.

Adding our menu options
Find this menu option line near the end of the file:

Code:
<siteMapNode title="Online Support" url="http://www.ablecommerce.com/crmtree.aspx" roles="*" />


And copy/paste the entire line below the original line so you have two lines that look like this:

Code:
      <siteMapNode title="Online Support" url="http://www.ablecommerce.com/crmtree.aspx" roles="*" />
      <siteMapNode title="Online Support" url="http://www.ablecommerce.com/crmtree.aspx" roles="*" />


Why the Roles
In .Net-speak, this is known as an "External" link, and is considered un-secured in the Microsoft world. You must have the "roles='*'" on the end or .Net will automatically protect your site by ignoring any menu option pointing to an external link. Those wacky Redmond folks at it again, saving our world from insecure web installations.

Setting the Title and URL
By now, your keen powers of observation have led you to conclude that the copied line will be your new menu option. You beat me too it. Simply change the URL to whatever you want. In our case, we're going to set it to "http://www.google.com". While you're at it, go ahead and change the title value to "Google" so the option isn't confused with the real Help option.

Save the file and refresh your Admin page. Your new menu option awaits your gracious first click!

Conclusion
Adding new menu options to the Admin screen is really quite easy. Once you get the hang of how the file has to be laid out, alot of new choices present themselves. Remember that any future AC7 updates might overwrite this file, so be sure to back up revised AC7 files into a separate folder. That way you always have a copy to reference for changes after an update is installed.

Tags: , ,

AC7 Articles

Month List