well, you will have to assign custom actions to the XmlTreeNodes that are created from the Render method.
The CreateAllowedActions method is only useful for creating a Global set of actions for all of your nodes. If you want to customize the actions for specific nodes, you will need to change them in render.
So after you call base.Render(ref tree);
you will be able to iterate through the nodes of the tree and change the nodes allowed actions based on your criteria.
FYI: You don't have to create your own tree to do this anymore in v4.5, there are events that you can bind to in order to change the node before it is rendered.
see the AfterNodeRender event of the loadContent tree (that is if you want to modify the normal content tree actions)
Custom Tree Context Menu based on document type
After trying for some time now, I just have to ask here...
I would like to define the "CreateAllowedActions" for a custom tree based on their doctype.
Things like:
if (Node.GetCurrent().NodeTypeAlias("XXXXX"); { actions.Add(ActionPublish.Instance); }
or
Don't work...
Anyone can point me in the right direction?
What tree are you overriding?
What method(s) are you overriding?
can you post the whole method?
What I do is just get a specified NodeID from the content tree and split that to a custom tree:
well, you will have to assign custom actions to the XmlTreeNodes that are created from the Render method.
The CreateAllowedActions method is only useful for creating a Global set of actions for all of your nodes. If you want to customize the actions for specific nodes, you will need to change them in render.
So after you call base.Render(ref tree);
you will be able to iterate through the nodes of the tree and change the nodes allowed actions based on your criteria.
FYI: You don't have to create your own tree to do this anymore in v4.5, there are events that you can bind to in order to change the node before it is rendered.
see the AfterNodeRender event of the loadContent tree (that is if you want to modify the normal content tree actions)
Ah that brightens my thoughts!
Let me see how far your info will bring me.
Thank you very much!
Hi Arnold,
For an example how to manipulate actions check out this WIKI
Cheers,
Richard
is working on a reply...