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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user