Created
June 5, 2013 13:39
-
-
Save sitereactor/5713911 to your computer and use it in GitHub Desktop.
Very basic example of removing a node from the Content tree by a DocumentType alias.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using umbraco.BusinessLogic; | |
using umbraco.cms.presentation.Trees; | |
public class SecrectContent : ApplicationBase | |
{ | |
public SecrectContent() | |
{ | |
BaseContentTree.AfterNodeRender += BaseContentTree_AfterNodeRender; | |
} | |
void BaseContentTree_AfterNodeRender(ref XmlTree sender, ref XmlTreeNode node, EventArgs e) | |
{ | |
if(node.NodeType == "myDocTypeAlias") | |
sender.Remove(node); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That will get me startet. Quick note: NodeType is not doctype :-) (content, media,...) but I figure it out!