From 5f1725e807bbca4e4ff71e9bcd56a6a17292a924 Mon Sep 17 00:00:00 2001 From: "agrath@gmail.com" Date: Mon, 11 Jun 2012 11:08:51 -0100 Subject: [PATCH] Override Path property on Templates to reflect the TreePath for deep linking --- .../cms/businesslogic/template/Template.cs | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/umbraco/cms/businesslogic/template/Template.cs b/umbraco/cms/businesslogic/template/Template.cs index da13c421fe..f5c6585d80 100644 --- a/umbraco/cms/businesslogic/template/Template.cs +++ b/umbraco/cms/businesslogic/template/Template.cs @@ -159,6 +159,41 @@ namespace umbraco.cms.businesslogic.template return masterpageContent; } + public new string Path + { + get + { + List path = new List(); + Template working = this; + while (working != null) + { + path.Add(working.Id); + try + { + if (working.MasterTemplate != 0) + { + working = new Template(working.MasterTemplate); + } + 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; + } + } public string Alias {