abstract namespace specification to template.json so that module and theme templates can use their own naming conventions

This commit is contained in:
sbwalker
2023-08-28 09:03:05 -04:00
parent f22e0c4384
commit a857e3f31e
7 changed files with 56 additions and 17 deletions

View File

@ -173,15 +173,24 @@ namespace Oqtane.Controllers
DirectoryInfo rootFolder = Directory.GetParent(_environment.ContentRootPath);
string templatePath = Utilities.PathCombine(_environment.WebRootPath, "Themes", "Templates", theme.Template, Path.DirectorySeparatorChar.ToString());
if (!string.IsNullOrEmpty(theme.ThemeName))
{
theme.ThemeName = theme.ThemeName.Replace("[Owner]", theme.Owner).Replace("[Theme]", theme.Name);
}
else
{
theme.ThemeName = theme.Owner + ".Theme." + theme.Name;
}
if (theme.Template.ToLower().Contains("internal"))
{
rootPath = Utilities.PathCombine(rootFolder.FullName, Path.DirectorySeparatorChar.ToString());
theme.ThemeName = theme.Owner + ".Theme." + theme.Name + ", Oqtane.Client";
theme.ThemeName = theme.ThemeName + ", Oqtane.Client";
}
else
{
rootPath = Utilities.PathCombine(rootFolder.Parent.FullName, theme.Owner + ".Theme." + theme.Name, Path.DirectorySeparatorChar.ToString());
theme.ThemeName = theme.Owner + ".Theme." + theme.Name + ", " + theme.Owner + ".Theme." + theme.Name + ".Client.Oqtane";
theme.ThemeName = theme.ThemeName + ", " + theme.ThemeName + ".Client.Oqtane";
}
ProcessTemplatesRecursively(new DirectoryInfo(templatePath), rootPath, rootFolder.Name, templatePath, theme);