Okay
  Public Ticket #1874192
New window + back button
Closed

Comments

  •  1
    caiusblg started the conversation

    Hi,
    a couple of questions:

    - when i have events on agenda, clicking on them, the single page opens in a new window. Is it possible to open them in same window?

    - is it possible to have a kind of button in single event visualization to back to main page of events?

    Thanks in advance
    Claudio

  •  877
    Zhivko replied

    Hi,

    In your theme functions.php file add following actions:

    // Opens events in same window
    add_action('wp_footer', function() {
        ?>
        <script type="text/javascript">
            if (typeof jQuery.stecExtend === 'function') {
                jQuery.stecExtend(function (master) {
                    master.eventsHandler.eventToggle = function ($event) {
                        window.open($event.find('.stec-layout-event-single-page-link').attr('href'), '_self');
                        return false;
                    };
                });
            }
        </script>
        <?php
    });

    // Adds link before the event content. Replace href url with the actual link to the calendar
    add_action('stec_single_before_content', function() {
        ?>
        <a href="//link-to-calendar-here"><?php _e('Back to calendar', 'stec'); ?></a>
        <?php
    });

    // Adds link after the event content
    add_action('stec_single_after_content', function() {
        ?>
        <a href="//link-to-calendar-here"><?php _e('Back to calendar', 'stec'); ?></a>
        <?php
    });



    Stachethemes Developer

  •  1
    caiusblg replied

    THANKS A LOT Zhivko!

    Always very helpful!!!

    Claudio