allow module/theme template manifests to have custom names so that they do not conflict with .NET template.json

This commit is contained in:
sbwalker
2025-11-14 12:43:40 -05:00
parent 545096a753
commit b9497cbb56
4 changed files with 16 additions and 13 deletions

View File

@@ -183,9 +183,10 @@ namespace Oqtane.Controllers
foreach (string directory in Directory.GetDirectories(templatePath))
{
string name = directory.Replace(templatePath, "");
if (System.IO.File.Exists(Path.Combine(directory, "template.json")))
var manifest = Directory.GetFiles(directory, "*.json");
if (manifest.Any())
{
var template = JsonSerializer.Deserialize<Template>(System.IO.File.ReadAllText(Path.Combine(directory, "template.json")));
var template = JsonSerializer.Deserialize<Template>(System.IO.File.ReadAllText(manifest[0]));
template.Name = name;
template.Location = "";
if (template.Type.ToLower() != "internal")