• Resolved bredamcguigan

    (@bredamcguigan)


    HI

    I am using this plugin with Elementor but every link I add to a column opens in a new window, I have checked and the links are not set to open in a new tab or window.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The target blank is set on links no matter the option you set in elementor “wrappable” panel, so I’ve fixed the code; just replace the before_section_render(Element_Base $element) function, starting on line 77 and ending on line 91 in make-section-clickable-elementor.php , with this version:

    public static function before_section_render(Element_Base $element) {
        $link_settings = $element->get_settings_for_display('ra_element_link');
        if ($link_settings && !empty($link_settings['url'])) {
        	$target = ( isset( $link_settings['is_external']  ) && $link_settings['is_external']  =='on' ) ? '_blank' : '_self';
          $element->add_render_attribute(
            '_wrapper',
            [
              'data-ra-element-link' => json_encode($link_settings),
              'style' => 'cursor: pointer',
            	'target' => $target,
              'onClick' => 'window.open("' . $link_settings['url'] . '", "'. $target .'")',
            ]
          );
        }
      }

    You can find the formatted code in this pastebin

    https://pastebin.com/3BUsGbMM

    • This reply was modified 1 year, 8 months ago by Mad Max.
    Thread Starter bredamcguigan

    (@bredamcguigan)

    Thank you I will try this,

    Regards

    Breda

    you’re welcome!

    Plugin Author Riyadh Ahmed

    (@saju4wordpress)

    Hi @bredamcguigan @mad_max ,
    Thanks for reaching out. I want to tell you, there are many users who need this new tab. But lots of work on my hand I am too busy that’s why I did not figure out the new tab in the checkbox. It will be fixed Soon.
    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Links are opening in a new tab’ is closed to new replies.