Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #498487

    Hi Folks,

    when I’m inserting a theme shortcode button with link target “new window”, the code is:
    [av_button label='klick me klick me' link='page,469' link_target='_blank'...
    and it will open a new tab or window.

    But when I change it to
    [av_button label='klick me klick me' link='page,469' link_target='_top'...
    after saving there’s no more target at all in the html/href.

    Is there a possibility not to filter out that “_top”? Because the page with the button is loaded in an iframe, and the button should link into the whole browser window – the reason, why “_top” has been invented…

    Thanks a lot for an answer!

    Best wishes
    Stephan

    #498507

    Hey Stephan!

    It only accepts the current window or a new window.

    If you need to use _top then you can right click your page and view source and copy the button HTML and then paste it into a codeblock element and change the target that way.

    Best regards,
    Elliott

    #498519

    Hi Elliot,
    thanks for your fast answer. But unfortunatley the editors (exept me) don’t “speak” HTML. Isnt’ there any possibility for a filter in the functions.php? Or do you know the responsible file, which only accepts the “_blank”?
    That would be a really great help!
    Best regards,
    Stephan

    #499084

    Hey!

    Please turn on the custom css class field. http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/

    Modify the buttons that requires a target=”_top” attribute. In the custom css class field, add something like “custom-button”. Update the page. Add this in the functions.php file afterwards:

    // target _top
    function add_custom_script(){
    ?>
    <script>
    (function($) {
    	$('.custom-button a').each(function() {
    		$(this).removeAttr('target');
    		$(this).attr('target', '_top');
    	});
    })(jQuery);
    </script>
    <?php
    }
    add_action('wp_footer', 'add_custom_script');

    If you’re working on a shortcode, just add this parameter inside the button shortcode:

    custom_class='custom-button'
    

    Regards,
    Ismael

    #499486

    Great! Thousand Thanx – best support ever.
    Stephan

    #499540

    Hey!

    Glad you got it shorted out!

    Best regards,
    Basilis

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘theme shortcode button looses target "_top", but "_blank" works’ is closed to new replies.