How to add items only to specific nodes in a tree based on the DocType?
Hi all,
I am adding a menu item to the content tree using BaseContentTree_BeforeNodeRender, what I wanted to be able to do was add the menu item only to certain nodes based on their NodeType, but, it seems that although the name of the node changes (node.Text) to reflex the current menu item, the node type (node.NodeType) always returns "content" which to me seems pretty ilogical.. is this a bug and does anyone have an elegant solution for this?
The nodetype is the type of the node, not the document type so this behaviour is correct.
When you want to use the doctype you need to get that form the document class.I've made an example using the following event handler. If you run this code the variable doctype will be different. I think this will introduce a performance penalty, not sure.
public void BaseContentTree_BeforeNodeRender(refXmlTree sender, refXmlTreeNode node, EventArgs e)
How to add items only to specific nodes in a tree based on the DocType?
Hi all,
I am adding a menu item to the content tree using BaseContentTree_BeforeNodeRender, what I wanted to be able to do was add the menu item only to certain nodes based on their NodeType, but, it seems that although the name of the node changes (node.Text) to reflex the current menu item, the node type (node.NodeType) always returns "content" which to me seems pretty ilogical.. is this a bug and does anyone have an elegant solution for this?
Cheers,
Chris
Hi Chris,
The nodetype is the type of the node, not the document type so this behaviour is correct.
When you want to use the doctype you need to get that form the document class.I've made an example using the following event handler. If you run this code the variable doctype will be different. I think this will introduce a performance penalty, not sure.
Hope it helps you,
Richard
Thanks Richard, Just what I needed.
Cheers,
Chris
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.