Skip to content

Commit

Permalink
TMZ-322 flex hero - move layout preset in content section
Browse files Browse the repository at this point in the history
  • Loading branch information
mserino committed Jan 30, 2025
1 parent 7f16924 commit 591844a
Showing 1 changed file with 50 additions and 37 deletions.
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

0 comments on commit 591844a

Please sign in to comment.