Okay
  Public Ticket #1769105
Add Custom Tab and Hide Default Tab on Single Event view
Closed

Comments

  • allegrodev started the conversation

    Hello,

    We have added a custom tab and also hid a default tab according to this article:

    https://stachethemes.ticksy.com/article/13229/

    This works perfectly on agenda view but it seems like the custom tab and default hidden tab do not apply on the single stec event page.

    What do we have to do to get this to work on the single event page?

    Thanks.

  • allegrodev replied

    Just wanted to follow up and see if there was any direction here?

  •  877
    Zhivko replied

    What version of the plugin are you using?


    Stachethemes Developer

  • allegrodev replied

    We updated to the latest version and the custom tab shows up but not the content under the custom tab. I think it is missing javascript code that loads the content like the one that's in the tutorial to load on the agenda view. We also need something to load on the single event view I think? 

  •  877
    Zhivko replied

    Hi,

    Step 5 was missing one line of code. I've updated the article and will paste the code here:

    /**
     * Step 5: Display the tab content via Javascript 
     */
    add_action('wp_head', function() {
        ?>    
        <script type="text/javascript">
            (function ($) {
                $(function () {
                    // Calendar 
                    $(document).on('onEventToggleOpen', function (e, data) {
                        data.$instance.find('.stec-layout-event-inner-my-custom-tab').html(data.event.custom_input_name);
                    });
                    // Single Page
                    if ($('.stec-layout-single').length > 0) {
                        $('.stec-layout-single-my-custom-tab').html(stecSingleEvent.custom_input_name);
                    }
                });
            })(jQuery);
        </script>    
        <?php
    });



    Stachethemes Developer