Include Tribe Bar on Every Page

Home Forums Calendar Products Events Calendar PRO Include Tribe Bar on Every Page

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #90536
    Adam Listek
    Participant

    Hello,
    The site I am developing has a requirement to have the event search bar (Tribe Bar) on every page. I could not get it to include (with all relevant stylesheets and javascript resources) correctly no matter what enqueue’s and includes I did. I am wondering if I am just mis-understanding this or if there is a simple way to include those resources and the Tribe Bar on every page. Please note that the intended functionality is to redirect to the search results page on use of the bar on any page other than the events one (i.e. no AJAX for all non-events pages).

    At the moment, I have nearly re-created the bar using custom queries and custom code that just constructs a query and redirects using those GET requests on the events page but I would love to use the actual Tribe Bar functionality and code.

    Thank you for your time!

    -Adam

    #91579
    Barry
    Member

    Hi Adam,

    Sounds like a fun project – I have to admit though that’s not something I’ve tried before and I would really count it as an advanced customization. Apart from including the various templates that make up the Tribe bar you would need to ensure all scripts/stylesheets it depends upon are enqueued and that any variables it expects to be in scope have been injected.

    I get the impression you’re already aware of that sort of thing but, I’m afraid, this sort of customization just isn’t something we can really help you with. It’s really not something that was designed with inclusion on arbitrary pages in mind – so though I’ve got no doubt it’s possible, we’ve have to leave the nuts and bolts to you.

    Good luck!

    #91754
    Adam Listek
    Participant

    Hi Barry,

    Wish this was just a fun project, it’s for a client so a requirement of the project 🙂 That being said, I have figured out a good way to do this I think but I would like some help with the searching aspect of the plugin.

    For others, what I have done is the following.

    1) Created a custom form search that POSTS to nothing (action=””)
    2) Functions.php has the following to intercept the form and do appropriate actions:

    function redirect_tribe() {
    //var_dump($_POST[‘thrive-custom’][0]);
    if (isset($_POST[‘thrive-custom’])) {
    if (empty($_POST[‘thrive-custom’][0])) {
    $date = date(‘Y-m’);
    } else {
    $date = urlencode($_POST[‘thrive-custom’][0]);
    }

    $query = Some custom query code for the GET response

    wp_redirect(home_url(“/events/” . $date . “/” . $query));
    exit();
    }
    }
    add_action(‘template_redirect’, ‘redirect_tribe’ );

    3) Validation and other things, etc.

    The question though is that although I can get it to pick up the date modifiers, I find that it can’t pick up the other query variables, which I believe is due to the AJAX nature of the tribe bar.

    What are the other query variables that are passed to plugin via a URL that I can use to search on (i.e. /2013-12/?tag=test&search=something).

    -Adam

    #92115
    Barry
    Member

    Sorry Adam, but again I’d emphasize we can’t help with advanced customizations like this one. You would need to dig into the code and figure things out that way – though we could certainly provide a list of suitable independent devs and freelancers who could assist if you need additional support on this one?

    #98295
    Barry
    Member

    I’ll close this one out.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Include Tribe Bar on Every Page’ is closed to new replies.