Improve Asset Path Handling and Add Preview Action: Enhanced the ImportHtmlTemplates command to support fallback asset paths for better template import functionality. Updated the TemplateService to handle old asset paths. Added a preview action in the SectionTemplates localization files for improved user experience in template management.

This commit is contained in:
Ümit Tunç
2025-12-27 09:45:10 +03:00
parent f609eb3ec1
commit 537e2769cd
4 changed files with 20 additions and 10 deletions
+5
View File
@@ -641,6 +641,11 @@ class TemplateService
if (str_starts_with($value, 'templates/')) {
return asset('storage/' . $value);
}
// Support for old assets/ path (if import not run)
if (str_starts_with($value, 'assets/')) {
return asset($value);
}
// If it's already using asset() or Storage::url(), assume it's already formatted
// Otherwise, prepend storage/ if it looks like a storage path