Modifying WorkSite Web Menus
I'd like to hide/remove the "View as HTML" option from the WorkSite Web document action menu. I was forwarded a copy of the Interwoven blog post: How to Modify the WorkSite Web Menus and successfully completed the example of removing the "declare as record" option.
However, when I locate all references of "view as html", comment them out per the blog instructions, and then recycle IIS and log in I get java script errors as well as the entire Action menu disappears.
Based on my text search within the clientmenus.js file I find "view as html" referenced in three sections. Lines 2030-2034, 2474-2476, and 2030-2034. I've tried multiple combinations of comment out all, some, or one of the sections at a time (save file, recycle IIS, repeat) but can not simply remove the "view as html" option.
Any suggestions?
======================================
Below is a copy of the blog post:
March 24, 2008
________________________________________
How to Modify the WorkSite Web Menus
Building off of my previous posting, "How to make the description field required in WorkSite Web" posted on February 12th, another common question about WorkSite Web is "how can I modify the default action menus." For the most part modifying the menus is an easy task. Usually this is done to remove or rename some of the menu items. The most commonly removed item is the "declare as record" option.
To start we need to find out where the WorkSite Web menus are located. We conveniently store all of the menu items in one file, clientmenus.js. This is located in the includes directory. Each menu type has been separated into a separate function.
Now that we know where the menus are stored lets go ahead and remove the "declare as record" option. When modifying the menus the easiest way to find all references to a particular item is to simply search for the command name. In this case we want to search for "Declare as Record". We should only find two entries for this command. The first entry you will find is in the document function.
var scriptStr = "performMiscDocOp('" + javaString(pObj.nrtid) + "', 'freeze', true)"
menu.addItem(new MenuItem("1492|Declare as Record",
new Function(scriptStr),
"","../images/record.gif"))
To remove this entry from the menu you can simply comment out the lines like the code snippet below.
// var scriptStr = "performMiscDocOp('" + javaString(pObj.nrtid) + "', 'freeze', true)"
// menu.addItem(new MenuItem("1492|Declare as Record",
// new Function(scriptStr),
// "","../images/record.gif"))
Next we want to search for any other instances for this command. We should find the last instance in the multiOpDocumentMenu function. Again, we simply want to command out the line like we did above.
One thing to keep in mind when doing customizations is that you will need to re-apply these changes when you upgrade WorkSite Web to a later release.
Posted by Ryan Citta in WorkSite Development
Feedback on this Post
======================================
Thank you.