deodat

Forum Replies Created

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • deodat
    Participant

    Hi Jeremy,

    well the error vanished 🙂

    Anyway, thanks for your help,

    Cheers,

    David

    in reply to: Place the filter bar after the title #1595276
    deodat
    Participant

    Sky,

    You put me on the road.

    This actually works for me :

    In functions.php :

    remove_action( 'wp_enqueue_scripts', array( Tribe__Events__Filterbar__View::instance(), 'enqueueStylesAndScripts' ), 11 );

    and in the modified and copied title-bar.php template :

    <?php tribe_get_template_part( 'filter-bar/filter-view-horizontal' ); ?>

    easy peasy 🙂

    Thanks a lot,

    David

    in reply to: Place the filter bar after the title #1595275
    deodat
    Participant

    This reply is private.

    in reply to: Place the filter bar after the title #1595274
    deodat
    Participant

    Hi Sky,

    I’m sorry but I’m confused here because, for me, this template part is not for the filter bar but for the Events Navigation Bar (located here : /the-events-calendar/src/views/modules/bar.php).

    I can’t find something similar in The Events Calendar Filterbar plugin.

    The only chunk of code where I can move this filter bar is the one I indicated earlier :

    the-events-calendar-filterbar/src/Tribe/View.php

            if ( $show_filter ) {
                // Only display filters before template if the layout is horizontal
                if ( tribe_get_option( 'events_filters_layout', 'vertical' ) == 'vertical' ) {
                    add_action( 'tribe_events_bar_after_template', array( $this, 'displaySidebar' ), 25 );
                } else {
                    if ( tribe_get_option( 'tribeDisableTribeBar', false ) == true ) {
                        add_action( 'tribe_events_after_the_title', array( $this, 'displaySidebar' ), 25 ); // MY OVERRIDE
                    } else {
                        add_action( 'tribe_events_bar_after_template', array( $this, 'displaySidebar' ), 25 );
                    }
                }
            }

    But it will be great indeed if I could just use a template part.

    I give you my credentials in the next private message.

    Regards,

    David

    in reply to: Place the filter bar after the title #1594591
    deodat
    Participant

    when I’m adding all the original code of the Tribe__Events__Filterbar__View Class (with just my override), it quite works … but my filter is displayed twice 🙁

    I don’t understand why.

    in reply to: Place the filter bar after the title #1594584
    deodat
    Participant

    I managed to remove the filter bar like this :

    remove_action( 'wp_enqueue_scripts', array( Tribe__Events__Filterbar__View::instance(), 'enqueueStylesAndScripts' ), 11 );

    but I can’t manage to add it after that with a custom Class like this :

    class MyTheme__Events__Filterbar__View extends Tribe__Events__Filterbar__View {
        public function enqueueStylesAndScripts() {
            
            ... some original code ...
    
            $show_filter = apply_filters( 'tribe_events_filters_should_show', in_array( get_post_type(), array( Tribe__Events__Main::VENUE_POST_TYPE, Tribe__Events__Main::ORGANIZER_POST_TYPE ) ) ? false : true );
    
            if ( $show_filter ) {
                // Only display filters before template if the layout is horizontal
                if ( tribe_get_option( 'events_filters_layout', 'vertical' ) == 'vertical' ) {
                    add_action( 'tribe_events_bar_after_template', array( $this, 'displaySidebar' ), 25 );
                } else {
                    if ( tribe_get_option( 'tribeDisableTribeBar', false ) == true ) {
                        add_action( 'tribe_events_after_the_title', array( $this, 'displaySidebar' ), 25 ); // MY OVERRIDE
                    } else {
                        add_action( 'tribe_events_bar_after_template', array( $this, 'displaySidebar' ), 25 );
                    }
                }
            }
    
            ... some original code ...
    
        }
    
    }
    
    add_action( 'wp_enqueue_scripts', array( MyTheme__Events__Filterbar__View::instance(), 'enqueueStylesAndScripts' ), 11 );
    in reply to: Place the filter bar after the title #1594514
    deodat
    Participant

    This reply is private.

    in reply to: Place the filter bar after the title #1594502
    deodat
    Participant

    This reply is private.

    in reply to: Place the filter bar after the title #1592686
    deodat
    Participant

    This reply is private.

Viewing 9 posts - 1 through 9 (of 9 total)