Add industry and text slide sections to homepage settings: introduce new fields in HomeSettings, update form structure in HomePageSettings, and modify homepage view to display dynamic content for industry and text slide areas.
This commit is contained in:
@@ -8,6 +8,7 @@ use Filament\Forms\Components\Section;
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Textarea;
|
||||
use Filament\Forms\Components\FileUpload;
|
||||
use Filament\Forms\Components\Repeater;
|
||||
use Filament\Forms\Form;
|
||||
use Filament\Pages\Page;
|
||||
use Filament\Pages\SettingsPage;
|
||||
@@ -62,8 +63,7 @@ class HomePageSettings extends SettingsPage
|
||||
->maxLength(255),
|
||||
Textarea::make('about_paragraph')
|
||||
->label('About Paragraph')
|
||||
->rows(5)
|
||||
->maxLength(65535),
|
||||
->rows(5) ->maxLength(65535),
|
||||
Grid::make()->schema([
|
||||
TextInput::make('about_projects_text')
|
||||
->label('Projects Text')
|
||||
@@ -130,6 +130,110 @@ class HomePageSettings extends SettingsPage
|
||||
->maxLength(255)
|
||||
->url(),
|
||||
]),
|
||||
|
||||
Section::make('Industry Area')
|
||||
->description('Manage the content for the industry area section.')
|
||||
->icon('heroicon-o-building-office')
|
||||
->schema([
|
||||
TextInput::make('industry_subtitle')
|
||||
->label('Subtitle')
|
||||
->maxLength(100),
|
||||
TextInput::make('industry_header')
|
||||
->label('Header')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
Textarea::make('industry_paragraph')
|
||||
->label('Paragraph')
|
||||
->rows(3)
|
||||
->maxLength(65535),
|
||||
Grid::make()->schema([
|
||||
TextInput::make('industry_button_text')
|
||||
->label('Button Text')
|
||||
->maxLength(50),
|
||||
TextInput::make('industry_button_url')
|
||||
->label('Button URL')
|
||||
->maxLength(255)
|
||||
->url(),
|
||||
])->columns(2),
|
||||
FileUpload::make('industry_image_one')
|
||||
->label('Industry Image One (520x400)')
|
||||
->image()
|
||||
->maxSize(2048)
|
||||
->disk('public')
|
||||
->directory('industry-images'),
|
||||
Repeater::make('industry_items')
|
||||
->label('Industry Items')
|
||||
->schema([
|
||||
FileUpload::make('icon')
|
||||
->label('Icon (SVG)')
|
||||
->directory('industry-icons')
|
||||
->acceptedFileTypes(['image/svg+xml'])
|
||||
->maxSize(1024) // 1MB
|
||||
->required(),
|
||||
TextInput::make('title')
|
||||
->label('Title')
|
||||
->required()
|
||||
->maxLength(100),
|
||||
Textarea::make('description')
|
||||
->label('Description')
|
||||
->rows(2)
|
||||
->maxLength(255),
|
||||
])
|
||||
->columns(2)
|
||||
->minItems(1)
|
||||
->maxItems(5)
|
||||
->defaultItems(2)
|
||||
->reorderable()
|
||||
->collapsible(),
|
||||
]),
|
||||
|
||||
Section::make('Text Slide Area')
|
||||
->description('Manage the content for the text slide area section.')
|
||||
->icon('heroicon-o-chat-bubble-bottom-center-text')
|
||||
->schema([
|
||||
TextInput::make('text_slide_subtitle')
|
||||
->label('Subtitle')
|
||||
->maxLength(100),
|
||||
TextInput::make('text_slide_header')
|
||||
->label('Header')
|
||||
->required()
|
||||
->maxLength(255),
|
||||
FileUpload::make('text_slide_image')
|
||||
->label('Text Slide Image (540x350)')
|
||||
->image()
|
||||
->maxSize(2048)
|
||||
->disk('public')
|
||||
->directory('text-slide-images'),
|
||||
TextInput::make('text_slide_counter_number')
|
||||
->label('Counter Number')
|
||||
->numeric()
|
||||
->default(29),
|
||||
Repeater::make('text_slide_items')
|
||||
->label('Text Slide Items')
|
||||
->schema([
|
||||
FileUpload::make('icon')
|
||||
->label('Icon (SVG)')
|
||||
->directory('text-slide-icons')
|
||||
->acceptedFileTypes(['image/svg+xml'])
|
||||
->maxSize(1024) // 1MB
|
||||
->required(),
|
||||
TextInput::make('link')
|
||||
->label('Link')
|
||||
->required()
|
||||
->url()
|
||||
->maxLength(255),
|
||||
TextInput::make('text')
|
||||
->label('Text')
|
||||
->required()
|
||||
->maxLength(100),
|
||||
])
|
||||
->columns(3)
|
||||
->minItems(1)
|
||||
->maxItems(10)
|
||||
->defaultItems(6)
|
||||
->reorderable()
|
||||
->collapsible(),
|
||||
]),
|
||||
])
|
||||
->columns(1)
|
||||
->statePath('data');
|
||||
|
||||
@@ -44,6 +44,30 @@ class HomeSettings extends Settings
|
||||
|
||||
public string $about_image_two;
|
||||
|
||||
public string $industry_subtitle;
|
||||
|
||||
public string $industry_header;
|
||||
|
||||
public string $industry_paragraph;
|
||||
|
||||
public string $industry_button_text;
|
||||
|
||||
public string $industry_button_url;
|
||||
|
||||
public string $industry_image_one;
|
||||
|
||||
public array $industry_items;
|
||||
|
||||
public string $text_slide_subtitle;
|
||||
|
||||
public string $text_slide_header;
|
||||
|
||||
public string $text_slide_image;
|
||||
|
||||
public int $text_slide_counter_number;
|
||||
|
||||
public array $text_slide_items;
|
||||
|
||||
public static function group(): string
|
||||
{
|
||||
return 'cms_homepage';
|
||||
|
||||
Reference in New Issue
Block a user