Filter Bar as a Widget?

Home Forums Calendar Products Filter Bar Filter Bar as a Widget?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #211400
    efromdc
    Participant

    Hey people…

    Im looking at the video for the Filter bar and this seems to add a column to your events page in vertical mode.

    Is it possible to use the filter bar as a widget instead? That way, you aren’t sqeezing your events together into a smaller space if you are already using the side bar 🙂

    Thanks…

    #211629
    Brook
    Participant

    Howdy efromdc,

    That is a very interesting question! You certainly could do that, it would take a little bit of work:

    1. Disable the filterbar from displaying by adding this line:
      `add_filter(‘tribe_events_filters_should_show’, ‘__return_false’);
    2. Create a new WP Page Template. Copy the code from your page or blog template that you currently use into this. If you want a blank widget area, then remove the register_sidebar call.
    3. Then get ahold of the TribeEventsFilterView::instance(), and simply call TribeEventsFilterView::displaySidebar() where you want it to be displayed within that page template.

    I like the way you think! Please let me know how this goes if you are able to do it. This might even be a good idea for one of our tutorials. Cheers sir!

    – Brook

    #213565
    efromdc
    Participant

    I actually DONT own the plug-in. I was going off the video preview.

    I have a related question: It appears that the category selector lists cats in alphabetical order. Does it respect hierarchies? For example, if I have the following categories:
    Apples
    — Granny Smith (sub-category)
    — Macintosh (sub-category)
    Bananas

    Will it respect the hierarchy and list apples, granny smith, macintosh, bananas? Or will it REMOVE the hierarchy and do STRICT alphabetical and list as apples, bananas, granny smith, macintosh?

    Thanks…

    #213567
    efromdc
    Participant

    To be clear, I meant will it list in hierarchy order > apples, granny smith, macintosh, bananas or will it do STRICT alphabetical order > apples, bananas, granny smith, macintosh?

    #214039
    Brook
    Participant

    I am happy to answer those questions. First..

    I actually DONT own the plug-in. I was going off the video preview.

    Knowing that changes my answer a little. It might be easier for you to simple wrap the filterbar in your theme’s sidebar HTML. For lots of themes this is something like:

    <div class="sidebar"><h2 class="widget-title">Filterbar</h2>[filterbar code]</div>

    This can be accomplished by a very simple theme overide, and can make the filterbar look like a widget area.

    The filterbar respects heirarchy, and lists in alphabetical order. However, there is a small glitch right now where sub categories are in rever alphabetical order. So this is actually what is happening:

    • A
    • B
      • Z
      • Y
      • X
    • C
    • D

    We will of course be fixing that though in the future. Let me know if there is anything else. Thanks efromdc!

    – Brook

    #680231
    lebearuk
    Participant

    add_filter(‘tribe_events_filters_should_show’, ‘__return_false’);
    This only hides the filter using CSS display: none;
    The following is taken from another post in the forum.
    function removeTribeFilterBarDefaultDisplay() {
    $filterClass = TribeEventsFilterView::instance();
    remove_action(‘tribe_events_before_template’, array($filterClass, ‘displaySidebar’), 25);
    remove_action(‘tribe_events_bar_after_template’, array($filterClass, ‘displaySidebar’), 25);
    }
    add_action( ‘wp_enqueue_scripts’, ‘removeTribeFilterBarDefaultDisplay’, 50 );
    It prevents the filter from being present in the code?
    I have created a folder in my child theme with the filter I would like to integrate to a widget allowing me to make some minor changes to the presentation. I’m trying to understand the following instruction.
    Then get ahold of the TribeEventsFilterView::instance(), and simply call TribeEventsFilterView::displaySidebar() where you want it to be displayed within that page template.

    So that I can add the filter to the sidebar. I’m currently adding the following code into a widget using a php snippet plugin.

    <?php
    ob_start();
    tribe_get_template_part( ‘filter-bar/filter-view-‘ . tribe_get_option( ‘events_filters_layout’, ‘vertical’ ) );
    $html = ob_get_clean() . $html;
    echo $html;
    ?>

    which is working when drilled down into a single view only and not from the /events/ page.
    Could you please give me example of step 3?

    #680237
    lebearuk
    Participant

    is it possible to edit a post? I’d prefer not to have my url / vhost directory included in the link

    #793211
    Brook
    Participant

    My apologies lebearuk. I was not purposefully ignoring you. Our support software does not work great when someone other than the Original Poster is in need of help. That is definitely one of the reasons why our forum rules request people open new topics for their issues. Basically there was a bug for a while where if someone other than the OP responded it would never update the status of the help ticket to say the topic needed help. That’s a bit embarassing, but hey it’s been fixed now.

    I edited your post to remove those bits. Do you still need help? I do not actually have a working example of #3. But, I might be able to help you a boit further if you are interested. If you do not mind though, would you open a new topic? I am actually going to close this one so that efromdc does not get more messages in his inbox. Feel free to link to this though, and maybe elaborate a bit on your roadblock if you still need assistance. We will be very happy to oblige. Cheers!

    – Brook

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Filter Bar as a Widget?’ is closed to new replies.