Override Path property on Templates to reflect the TreePath for deep linking
This commit is contained in:
@@ -159,6 +159,41 @@ namespace umbraco.cms.businesslogic.template
|
||||
return masterpageContent;
|
||||
}
|
||||
|
||||
public new string Path
|
||||
{
|
||||
get
|
||||
{
|
||||
List<int> path = new List<int>();
|
||||
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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user