From 65888b039e4e2fe51e4e37d282f1a36e8f456a2b Mon Sep 17 00:00:00 2001 From: "agrath@gmail.com" Date: Mon, 11 Jun 2012 11:09:13 -0100 Subject: [PATCH] Override Path property on DocumentTypes to reflect the TreePath for deep linking --- umbraco/cms/businesslogic/web/DocumentType.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/umbraco/cms/businesslogic/web/DocumentType.cs b/umbraco/cms/businesslogic/web/DocumentType.cs index 326fab6111..f4ed811c9e 100644 --- a/umbraco/cms/businesslogic/web/DocumentType.cs +++ b/umbraco/cms/businesslogic/web/DocumentType.cs @@ -255,6 +255,42 @@ namespace umbraco.cms.businesslogic.web } } } + + public new string Path + { + get + { + List path = new List(); + DocumentType working = this; + while (working != null) + { + path.Add(working.Id); + try + { + if (working.MasterContentType != 0) + { + working = new DocumentType(working.MasterContentType); + } + else + { + working = null; + } + } + catch (ArgumentException) + { + working = null; + } + } + path.Add(-1); + path.Reverse(); + string sPath = string.Join(",", path.ConvertAll(item => item.ToString()).ToArray()); + return sPath; + } + set + { + base.Path = value; + } + } #endregion #region Public Methods