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