• Resolved hakkow

    (@hakkow)


    Hi,

    I’ve been trying to use this plugin, and it works great for elements. But when I add the same condition to a section, it doesn’t seem to work. The section will always show, even though the conditions are copied from the element on which it does work.

    It would be really great if this would work for entire sections as well.

    Many thanks, Haiko

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter hakkow

    (@hakkow)

    I was able to fix this by adding the following to controls.php:

    add_action( 'elementor/frontend/element/before_render', function ( \Elementor\Element_Base $element ) {
        $settings = $element->get_active_settings();
    	if ( !isset($settings['element_condition']) || $settings['element_condition']=='' ) return $element;
        if ( elecond_parse_condition($settings['element_condition']) ) {
              return;
        }else{
            $element->add_render_attribute( '_wrapper', [
                'class' => 'hide-me'] );
        }
    
    } );

    And added a hide-me to the css containing display:none;

    Plugin Author dudaster

    (@dudaster)

    Cool I’ll patch it right away!

    Plugin Author dudaster

    (@dudaster)

    New version is up and I’ve added a debug mode: a nice addition not to be working in the dark if something is not working properly.

    Thread Starter hakkow

    (@hakkow)

    Nice! Thanks for the great plugin!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Conditions not working for section’ is closed to new replies.