Sydney FP Call to Action open link in blank window

We are using a Sydney Pro for a client and we are using the call to action to link to white papers and other documents for their clients. We are trying to add attributes to allow the link for the call to action to open in a new window.

the site is at http://apeirondata.net first button is for a white paper.

thanks in advance.

Kevin

Hello there,

In order to achieve that objective, could you please try to do the following?

  1. Install and activate the Header and Footer Scripts plugin
  2. Go To Settings > Header and Footer Scripts panel
  3. Paste the following code into the provided Scripts in footer box
<script>

(function($){

    "use strict";

    $('.widget_sydney_action a').attr('target', '_blank');
    

})(jQuery);

</script>
  1. Save settings

Let me know how it goes.

Regards,
Kharis

1 Like

That worked, thanks

Ok, so only problem with the fix, is that now the call to action widget cannot be used to link to a page.

Dear Kevin,

Thank you for updating me.

> is that now the call to action widget cannot be used to link to a page

It still can be used for that purpose.

Regards,
Kharis

Well yes it can be used, but it ends up opening the page in a new tab or window.

Is there a way to set it up so that the call to action can either open in a new tab, or just keep the current behavior. Usually in an href I can put _blank or not

thanks

Hello there,

I thought it can be accomplished by specifying a custom class name to the CTA widget which you wish its button should be opened in a new tab.

Edit the respective “Sydney FP: Call to action” widget > Widget Styles > Attributes > enter open-in-new-window class name in the field that says “Widget Class”.

Go To Settings > Header and Footer Scripts panel. Replace the JS script I previously suggested with the following:

<script>

(function($){

    "use strict";

    $('.widget_sydney_action .open-in-new-window a').attr('target', '_blank');
    

})(jQuery);

</script>

Let me know how it goes. I’ll wait to hear back from you regarding your stats.

Regards,
Kharis

Hi Kharis,

I like to have the same functionality but within the Sydney FP: List Widget. This widget also has a URL Call-To-Action-Button which target I’d like to be opened in a new tab.

Do I also have to install the Header and Footer Scripts plugin or is there any other way?

All the best,
Tom

Hello Tom,

Please try doing these steps to add _target="blank" attribute to the widget list button.

  1. Install and activate the TC Custom JavaScript plugin
  2. Go To Appearance > Custom JavaScript
  3. Paste the following code into the provided box
    jQuery(function($) {

      "use strict";

      $('.widget_list a.roll-button').attr('target', '_blank');  

    });

4 . Update

Regards,
Kharis

Hi,
I have tried various scripts / followed instructions by using the ‘Header and Footer scripts’ plugin as well as ‘TC Custom JavaScript’, but our Call-to-action button on the frontpage is still not opening in a new window.
Any news on this subject ?
Best regards,
Jochen Wilhelm

Hello there,

Do you have a link to your site to share here? So I can check and troubleshoot the code.

Regards,
Kharis

Yes, the page is :

The blue call-to-action button should go to
http://wvw.francoallemand.com/forms/pfae2019/index-fr.php

Hello there,

It looks like you site is being locked. Is there any other way that allows me to check your actual site?

Regards,
Kharis