Added GetTemplateNode and FindTemplateInTree to the IFileService
This commit is contained in:
@@ -233,6 +233,33 @@ namespace Umbraco.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a template as a template node which can be traversed (parent, children)
|
||||
/// </summary>
|
||||
/// <param name="alias"></param>
|
||||
/// <returns></returns>
|
||||
public TemplateNode GetTemplateNode(string alias)
|
||||
{
|
||||
using (var repository = _repositoryFactory.CreateTemplateRepository(_dataUowProvider.GetUnitOfWork()))
|
||||
{
|
||||
return repository.GetTemplateNode(alias);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given a template node in a tree, this will find the template node with the given alias if it is found in the hierarchy, otherwise null
|
||||
/// </summary>
|
||||
/// <param name="anyNode"></param>
|
||||
/// <param name="alias"></param>
|
||||
/// <returns></returns>
|
||||
public TemplateNode FindTemplateInTree(TemplateNode anyNode, string alias)
|
||||
{
|
||||
using (var repository = _repositoryFactory.CreateTemplateRepository(_dataUowProvider.GetUnitOfWork()))
|
||||
{
|
||||
return repository.FindTemplateInTree(anyNode, alias);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Saves a <see cref="Template"/>
|
||||
/// </summary>
|
||||
|
||||
@@ -96,6 +96,21 @@ namespace Umbraco.Core.Services
|
||||
/// <returns>A <see cref="ITemplate"/> object</returns>
|
||||
ITemplate GetTemplate(int id);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a template as a template node which can be traversed (parent, children)
|
||||
/// </summary>
|
||||
/// <param name="alias"></param>
|
||||
/// <returns></returns>
|
||||
TemplateNode GetTemplateNode(string alias);
|
||||
|
||||
/// <summary>
|
||||
/// Given a template node in a tree, this will find the template node with the given alias if it is found in the hierarchy, otherwise null
|
||||
/// </summary>
|
||||
/// <param name="anyNode"></param>
|
||||
/// <param name="alias"></param>
|
||||
/// <returns></returns>
|
||||
TemplateNode FindTemplateInTree(TemplateNode anyNode, string alias);
|
||||
|
||||
/// <summary>
|
||||
/// Saves a <see cref="ITemplate"/>
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user