diff --git a/uSync.BackOffice/Expansions/ISyncTreeNode.cs b/uSync.BackOffice/Expansions/ISyncTreeNode.cs index 9a67aded..c917397c 100644 --- a/uSync.BackOffice/Expansions/ISyncTreeNode.cs +++ b/uSync.BackOffice/Expansions/ISyncTreeNode.cs @@ -13,6 +13,11 @@ namespace uSync.BackOffice.Expansions /// public interface ISyncTreeNode { + /// + /// if the tree node is in-fact enabled. + /// + public bool Disabled { get; } + /// /// position in the tree, (higher is lower down the tree) /// diff --git a/uSync.BackOffice/Expansions/uSyncTreeController.cs b/uSync.BackOffice/Expansions/uSyncTreeController.cs index b76c3c42..fbb3fd09 100644 --- a/uSync.BackOffice/Expansions/uSyncTreeController.cs +++ b/uSync.BackOffice/Expansions/uSyncTreeController.cs @@ -77,7 +77,7 @@ protected override ActionResult GetTreeNodes(string id, [Mod if (id == Constants.System.RootString) { - foreach (var node in _treeNodes.OrderBy(x => x.Weight)) + foreach (var node in _treeNodes.Where(x => !x.Disabled).OrderBy(x => x.Weight)) { var treeNode = CreateTreeNode( node.Id, @@ -85,7 +85,7 @@ protected override ActionResult GetTreeNodes(string id, [Mod queryStrings, node.Title, node.Icon, - $"{SectionAlias}/{node.TreeAlias}/{node.Alias}"); + $"{SectionAlias}/{node.TreeAlias}/{node.Alias}"); var children = node.GetChildNodes(id, queryStrings); if (children?.Any() == true)