Enhance User Guide and Template Services: Added max content width configuration to UserGuide page for improved layout. Updated TemplateService to always replace placeholders, ensuring custom components are handled correctly even with empty default data. Enhanced error handling for custom component rendering, providing user-friendly error messages in the preview. Introduced a new guide for website setup, detailing installation steps and features.
This commit is contained in:
@@ -48,9 +48,9 @@ class TemplatePreviewController extends Controller
|
||||
}
|
||||
|
||||
// Replace placeholders with default data
|
||||
if (!empty($defaultData)) {
|
||||
$content = TemplateService::replacePlaceholders($content, $defaultData);
|
||||
}
|
||||
// Always call replacePlaceholders to handle custom components and special placeholders
|
||||
// even if defaultData is empty
|
||||
$content = TemplateService::replacePlaceholders($content, $defaultData ?? []);
|
||||
|
||||
$html = TemplatePreviewService::getPreviewHtml($content, $type);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user