This commit is contained in:
Hoang Huu 2019-09-13 11:11:59 +07:00
parent 558fb07261
commit 362dc5c097
3 changed files with 24 additions and 14 deletions

View File

@ -93,13 +93,23 @@ class Opalestate_search_property_results_Elementor_Widget extends Opalestate_Ele
$this->add_control(
'style',
[
'label' => esc_html__( 'Style Item Layout', 'opalestate-pro' ),
'label' => esc_html__( 'Style Grid Layout', 'opalestate-pro' ),
'type' => \Elementor\Controls_Manager::SELECT,
'options' => $this->get_template_post_type(),
'default' => 'grid',
]
);
$this->add_control(
'style_list',
[
'label' => esc_html__( 'Style List Layout', 'opalestate-pro' ),
'type' => \Elementor\Controls_Manager::SELECT,
'options' => $this->get_template_post_type(),
'default' => 'list',
]
);
$this->add_control(
'column',
[

View File

@ -1,14 +1,11 @@
<?php
$display = array(
$display = [
'style' => $settings['style'],
'column' => $settings['column']
);
// echo time().'<pre> ha congtein' . print_r( $display ,1 ).'</pre>';
'style_list' => $settings['style_list'],
'column' => $settings['column'],
];
?>
<div class="opalesate-properties-ajax opalesate-properties-results" data-mode="html">
<?php echo opalestate_load_template_path( 'shortcodes/ajax-map-search-result', $display ); ?>
</div>

View File

@ -35,16 +35,19 @@ $show = ( isset( $_GET['display'] ) && $_GET['display'] == 'list' ) || ( opalest
<?php if ( $query->have_posts() ): ?>
<div class="<?php echo apply_filters( 'opalestate_row_container_class', 'opal-row' ); ?>">
<?php if ( $show == 'list' ): ?>
<?php
$style_list = isset( $style_list ) && $style_list ? 'content-property-' . $style_list : $list_layout;
?>
<?php $cnt = 0;
while ( $query->have_posts() ) : $query->the_post(); ?>
<div class="col-lg-12 col-md-12 col-sm-12" data-related="map" data-id="<?php echo $cnt++; ?>">
<?php echo opalestate_load_template_path( $list_layout ); ?>
<?php echo opalestate_load_template_path( $style_list ); ?>
</div>
<?php endwhile; ?>
<?php else : ?>
<?php
$column = isset( $column ) ? $column : apply_filters( 'opalestate_properties_column_row', 3 );
$layout = isset( $style ) ? 'content-property-' . $style : $grid_layout;
$layout = isset( $style ) && $style ? 'content-property-' . $style : $grid_layout;
$clscol = floor( 12 / $column );
$cnt = 0;
while ( $query->have_posts() ) : $query->the_post();