Add language support for HTML in template forms: Updated HeaderTemplateForm and SectionTemplateForm to include language specification for CodeEditor components. Introduced a method in TemplatePreviewService to convert relative asset paths to absolute URLs in HTML content, enhancing template rendering accuracy.

This commit is contained in:
Ümit Tunç
2025-10-31 17:24:13 -03:00
parent 8d7b3f0914
commit 6ec04cfdde
3 changed files with 93 additions and 0 deletions
@@ -8,6 +8,7 @@ use Filament\Forms\Components\Toggle;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Components\View;
use Filament\Schemas\Schema;
use Filament\Forms\Components\CodeEditor\Enums\Language;
class HeaderTemplateForm
{
@@ -27,6 +28,7 @@ class HeaderTemplateForm
->label(__('header-templates.field_html_content'))
->required()
->live(onBlur: false) // Real-time updates
->language(Language::Html)
->columnSpanFull()
->helperText(__('header-templates.field_html_content_help'))
->extraAttributes([
@@ -8,6 +8,7 @@ use Filament\Forms\Components\Toggle;
use Filament\Schemas\Components\Section;
use Filament\Schemas\Components\View;
use Filament\Schemas\Schema;
use Filament\Forms\Components\CodeEditor\Enums\Language;
class SectionTemplateForm
{
@@ -27,6 +28,7 @@ class SectionTemplateForm
->label(__('section-templates.field_html_content'))
->required()
->live(onBlur: false) // Real-time updates
->language(Language::Html)
->columnSpanFull()
->helperText(__('section-templates.field_html_content_help'))
->extraAttributes([