Hi. I've added my own item into the context menu (by inheritting from ApplicationBase and implementing my own IAction action) no problem, however, 2 questions have arose from this:
1. The IAction.Alias is written out but within square brackets, is there any way to remove these?
2. Is there any way to have my custom menu item only display on certain content types?
To get rid of the brackets, I believe you need to add a key to the language file matching the Alias of your IAction. The language file should be in /umbraco/config/lang/<yourlang>.xml
Context Menu Items
Hi. I've added my own item into the context menu (by inheritting from ApplicationBase and implementing my own IAction action) no problem, however, 2 questions have arose from this:
1. The IAction.Alias is written out but within square brackets, is there any way to remove these?
2. Is there any way to have my custom menu item only display on certain content types?
Cheers
Ok, I've solved the 2nd issue by using the following (simplified for this example):
void BaseTree_BeforeNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e)
{
if (!String.Equals(node.NodeType, "content", StringComparison.OrdinalIgnoreCase)) return;
var content = new Content(int.Parse(node.NodeID));
if (!String.Equals(content.ContentType.Alias, "[DESIRED TYPE]")) return;
// do code here
}
Edit: And I've solved the first issue, the Alias property corrosponds to an Alias in the language files; umbraco/config/lang/
Hi,
To get rid of the brackets, I believe you need to add a key to the language file matching the Alias of your IAction. The language file should be in /umbraco/config/lang/<yourlang>.xml
-Tom
is working on a reply...