Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flex hero - move layout preset in content section [TMZ-322] #180

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 50 additions & 37 deletions modules/content/widgets/flex-hero.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ protected function register_controls() {
}

protected function add_content_section() {
$this->add_content_layout_section();
$this->add_content_text_section();
$this->add_content_cta_section();
$this->add_content_image_section();
Expand All @@ -79,6 +80,55 @@ protected function add_style_section() {
$this->add_style_box_section();
}

protected function add_content_layout_section() {
$this->start_controls_section(
'content_layout',
[
'label' => esc_html__( 'Layout', 'hello-plus' ),
'tab' => Controls_Manager::TAB_CONTENT,
]
);

$this->add_control(
'layout_preset',
[
'label' => esc_html__( 'Preset', 'hello-plus' ),
'type' => Controls_Manager::SELECT,
'default' => 'showcase',
'options' => [
'showcase' => esc_html__( 'Showcase', 'hello-plus' ),
'storytelling' => esc_html__( 'Storytelling', 'hello-plus' ),
],
]
);

$this->add_control(
'layout_preset_showcase_info',
[
'type' => Controls_Manager::ALERT,
'alert_type' => 'info',
'content' => esc_html__( 'Highlight key concepts with a balanced layout.', 'hello-plus' ),
'condition' => [
'layout_preset' => 'showcase',
],
]
);

$this->add_control(
'layout_preset_storytelling_info',
[
'type' => Controls_Manager::ALERT,
'alert_type' => 'info',
'content' => esc_html__( 'Focus on a narrative with supporting visuals.', 'hello-plus' ),
'condition' => [
'layout_preset' => 'storytelling',
],
]
);

$this->end_controls_section();
}

protected function add_content_text_section() {
$this->start_controls_section(
'content_text',
Expand Down Expand Up @@ -232,43 +282,6 @@ protected function add_style_layout_section() {
]
);

$this->add_control(
'layout_preset',
[
'label' => esc_html__( 'Preset', 'hello-plus' ),
'type' => Controls_Manager::SELECT,
'default' => 'showcase',
'options' => [
'showcase' => esc_html__( 'Showcase', 'hello-plus' ),
'storytelling' => esc_html__( 'Storytelling', 'hello-plus' ),
],
]
);

$this->add_control(
'layout_preset_showcase_info',
[
'type' => Controls_Manager::ALERT,
'alert_type' => 'info',
'content' => esc_html__( 'Highlight key concepts with a balanced layout.', 'hello-plus' ),
'condition' => [
'layout_preset' => 'showcase',
],
]
);

$this->add_control(
'layout_preset_storytelling_info',
[
'type' => Controls_Manager::ALERT,
'alert_type' => 'info',
'content' => esc_html__( 'Focus on a narrative with supporting visuals.', 'hello-plus' ),
'condition' => [
'layout_preset' => 'storytelling',
],
]
);

$this->add_responsive_control(
'layout_image_position',
[
Expand Down
Loading