Home Forums Space themes support forum Product Builder Image Gallery Widget Size Reply To: Product Builder Image Gallery Widget Size

#322098

newsprince
Participant

@Artem Temos.

No offense here, i believe you are one of the best team in market and produce the best themes but telling me that this element has a too complicated logic to implement a width image size option for the image product builder widget is plain excuse.

I added a few lines of code based on elementor’s guide and it works just like i described.

Here is the code

$this->add_responsive_control(
			'main_image_width',
			array(
				'label'      => esc_html__( 'Images Block Width (%)', 'xts-img-width-builder' ),
				'type'       => Controls_Manager::SLIDER,
				'size_units' => array( '%' ),
				'range'      => array(
					'%' => array(
						'min' => 0,
						'max' => 100,
					),
				),
				'default'    => array(
					'unit' => '%',
					'size' => 100,
				),
				'selectors'  => array(
					'{{WRAPPER}} ' . $css_scheme['images'] => 'width: {{SIZE}}% !important; float: none !important;',
				),
			)
		);

File:
/xts-hitek/framework/integration/elementor/elements/single-product/gallery/class-gallery.php

After line 131.

I attach a screen record to see it in action.

Thank you.