refactor: remove secondary landing page sections to enforce a hero-only product layout
This commit is contained in:
@@ -96,122 +96,7 @@ class LandingPageSection
|
||||
])
|
||||
->columns(2)
|
||||
->collapsible()
|
||||
->collapsed(),
|
||||
|
||||
// App Features Section
|
||||
Section::make(__('products.app_features_section'))
|
||||
->schema([
|
||||
Repeater::make('landing_page_data.features')
|
||||
->label(__('products.features'))
|
||||
->schema([
|
||||
Select::make('icon')
|
||||
->label(__('products.feature_icon'))
|
||||
->options($iconOptions)
|
||||
->searchable(),
|
||||
TextInput::make('title')
|
||||
->label(__('products.feature_title'))
|
||||
->columnSpanFull(),
|
||||
Textarea::make('description')
|
||||
->label(__('products.feature_description'))
|
||||
->rows(2)
|
||||
->columnSpanFull(),
|
||||
])
|
||||
->columns(1)
|
||||
->defaultItems(0)
|
||||
->addActionLabel(__('products.add_feature'))
|
||||
->reorderable()
|
||||
->collapsible()
|
||||
->itemLabel(fn (array $state): ?string => $state['title'] ?? __('products.feature') . ' #' . ($state['_index'] ?? ''))
|
||||
->columnSpanFull(),
|
||||
|
||||
// Note: Translations should match the order of features above
|
||||
// Each feature translation array index should correspond to the feature index
|
||||
])
|
||||
->collapsible()
|
||||
->collapsed(),
|
||||
|
||||
// How It Works Section
|
||||
Section::make(__('products.how_it_works_section'))
|
||||
->schema([
|
||||
FileUpload::make('landing_page_data.how_it_works.download_image')
|
||||
->label(__('products.how_it_works_image'))
|
||||
->image()
|
||||
->disk('public')
|
||||
->directory('products/landing')
|
||||
->columnSpanFull(),
|
||||
TextInput::make('landing_page_data.how_it_works.download_form_label')
|
||||
->label(__('products.download_form_label'))
|
||||
->placeholder(__('products.download_form_label_placeholder'))
|
||||
->columnSpanFull(),
|
||||
|
||||
// Steps (4 steps with translations)
|
||||
Repeater::make('landing_page_data.how_it_works.steps')
|
||||
->label(__('products.steps'))
|
||||
->schema([
|
||||
TextInput::make('number')
|
||||
->label(__('products.step_number'))
|
||||
->numeric()
|
||||
->default(fn ($get) => ($get('../../../_index') ?? 0) + 1),
|
||||
TextInput::make('title')
|
||||
->label(__('products.step_title'))
|
||||
->columnSpanFull(),
|
||||
Textarea::make('description')
|
||||
->label(__('products.step_description'))
|
||||
->rows(2)
|
||||
->columnSpanFull(),
|
||||
])
|
||||
->columns(1)
|
||||
->defaultItems(0)
|
||||
->reorderable()
|
||||
->collapsible()
|
||||
->itemLabel(fn (array $state): ?string => __('products.step') . ' ' . ($state['number'] ?? '') . ': ' . ($state['title'] ?? ''))
|
||||
->columnSpanFull(),
|
||||
|
||||
// Note: Steps translations should match the order of steps above
|
||||
// Each step translation array index should correspond to the step index
|
||||
])
|
||||
->collapsible()
|
||||
->collapsed(),
|
||||
|
||||
// Video Section
|
||||
Section::make(__('products.video_section'))
|
||||
->schema([
|
||||
TextInput::make('landing_page_data.video.youtube_video_id')
|
||||
->label(__('products.youtube_video_id'))
|
||||
->placeholder('165101721')
|
||||
->helperText(__('products.youtube_video_id_helper'))
|
||||
->columnSpanFull(),
|
||||
])
|
||||
->collapsible()
|
||||
->collapsed(),
|
||||
|
||||
// FAQ Section
|
||||
Section::make(__('products.faq_section'))
|
||||
->schema([
|
||||
Repeater::make('landing_page_data.faqs')
|
||||
->label(__('products.faqs'))
|
||||
->schema([
|
||||
TextInput::make('question')
|
||||
->label(__('products.faq_question'))
|
||||
->columnSpanFull(),
|
||||
Textarea::make('answer')
|
||||
->label(__('products.faq_answer'))
|
||||
->rows(3)
|
||||
->columnSpanFull(),
|
||||
])
|
||||
->columns(1)
|
||||
->defaultItems(0)
|
||||
->addActionLabel(__('products.add_faq'))
|
||||
->reorderable()
|
||||
->collapsible()
|
||||
->itemLabel(fn (array $state): ?string => $state['question'] ?? __('products.faq') . ' #' . ($state['_index'] ?? ''))
|
||||
->columnSpanFull(),
|
||||
|
||||
// Note: FAQ translations should match the order of FAQs above
|
||||
// Each FAQ translation array index should correspond to the FAQ index
|
||||
])
|
||||
->collapsible()
|
||||
->collapsed(),
|
||||
->collapsed(false),
|
||||
])
|
||||
->visible(fn (Get $get) => $get('type') === 'product')
|
||||
->columnSpanFull();
|
||||
|
||||
@@ -74,12 +74,7 @@ class ProductController extends Controller
|
||||
return view($product->view_template, compact('product', 'settings', 'renderedHeader', 'renderedFooter', 'meta'));
|
||||
}
|
||||
|
||||
// Use landing page template if landing_page_data exists
|
||||
if (!empty($product->landing_page_data)) {
|
||||
return view('front.products.landing', compact('product', 'settings', 'renderedHeader', 'renderedFooter', 'meta'));
|
||||
}
|
||||
|
||||
// Default view
|
||||
return view('front.products.show', compact('product', 'settings', 'renderedHeader', 'renderedFooter', 'meta'));
|
||||
// Use landing page template (Hero only) for all products
|
||||
return view('front.products.landing', compact('product', 'settings', 'renderedHeader', 'renderedFooter', 'meta'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user