Add template preview functionality: Introduced TemplatePreviewController and TemplatePreviewService for rendering dynamic previews of header, footer, and section templates. Updated form schemas to include preview components and enhanced real-time content updates. Added configuration for template assets and integrated preview functionality into the admin panel.

This commit is contained in:
Ümit Tunç
2025-10-31 16:48:36 -03:00
parent 67d8b4c781
commit 52c4ba1b19
8 changed files with 578 additions and 9 deletions
+54
View File
@@ -0,0 +1,54 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Template Preview Asset Configuration
|--------------------------------------------------------------------------
|
| This configuration file contains all asset paths that should be loaded
| in the template preview iframe. These assets are used to ensure the
| preview displays correctly with the same styling and scripts as the
| actual site.
|
| You can override these values in Settings table if needed, or modify
| this config file for project-specific asset paths.
|
*/
// CSS Assets (Stylesheets)
'css' => [
'style' => 'html/style.css',
'unicons' => 'assets/fonts/unicons/unicons.css',
'plugins' => 'assets/css/plugins.css',
'colors' => 'assets/css/colors/grape.css',
'fonts' => 'assets/css/fonts/urbanist.css',
],
// JavaScript Assets
'js' => [
'plugins' => 'assets/js/plugins.js',
'theme' => 'assets/js/theme.js',
],
// Additional meta tags and head content
'meta' => [
'viewport' => 'width=device-width, initial-scale=1',
'charset' => 'utf-8',
],
// Whether to load assets from Settings table (overrides config)
'use_settings_override' => false,
// Settings keys for asset paths (if use_settings_override is true)
'settings_keys' => [
'css_style' => 'template_preview_css_style',
'css_unicons' => 'template_preview_css_unicons',
'css_plugins' => 'template_preview_css_plugins',
'css_colors' => 'template_preview_css_colors',
'css_fonts' => 'template_preview_css_fonts',
'js_plugins' => 'template_preview_js_plugins',
'js_theme' => 'template_preview_js_theme',
],
];