Timber not working with the Filter Bar

Home Forums Calendar Products Filter Bar Timber not working with the Filter Bar

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #972310
    Luke
    Participant

    Hi, I am trying to get the Filter Bar working with the Timber Templating Engine Plugin. Right now I have:

    
    ob_start();
      tribe_events_before_html();
      tribe_get_view(); 
      tribe_events_after_html();
      $tribe_dump = ob_get_contents();
    ob_end_clean();
    
    $context = Timber::get_context();
    $context['tribe_dump'] = $tribe_dump;
    Timber::render('templates/pages/index.twig', $context);
    

    Which seems to work fine. However the filter bar does will not show up. I have tried outputing the theme without using Timber and the filter bar will show up then. Whatever hook is used for rendering the filter bar does not seem to be triggering.

    Thanks

    #972503
    Barry
    Member

    Hi Luke,

    That’s an interesting question – though I should highlight straight off the bat that the level of support we can offer for custom code is fairly limited.

    Can you provide any more context – where and when is this code running exactly (is this a template override for one of our own existing templates – where you happen to be using Timber – or is it a different template altogether) and can you link me to a live example?

    #972558
    Luke
    Participant

    Thanks Barry. I have seemed to get it to work by changing my tribe-events/default-template.php to:

    
    $context = Timber::get_context();
    Timber::render('templates/pages/events.twig', $context);
    

    and my events.twig to:

    
    {% extends "templates/layouts/default.twig" %}
    
    {% block content %}
      <div class = "row">
        <div class = "small-12 columns">
          {{fn('tribe_events_before_html')}}
          {{fn('tribe_get_view')}}
          {{fn('tribe_events_after_html')}}
        </div>
      </div>
    {% endblock %}
    

    The rendering seems to occur far enough down the pipeline where the proper hooks.

    #972564
    Barry
    Member

    Great!

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Timber not working with the Filter Bar’ is closed to new replies.