Creating events search form on homepage

Home Forums Welcome! Pre-Sales Questions Creating events search form on homepage

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1616011
    Kyle Anderson
    Guest

    Hi,

    I am currently struggling to implement a search form based off of Events Calender Pro and the filter bar add-on. We purchased the filter bar to make the following process easier but it has proven to be anything but easier.
    Essentially I need three fields (Categories, City and Province/State) with a submit button, naturally.

    I have managed to generate the submit button and a categories dropdown which works perfectly, however I can’t seem to generate the city and Province/States dropdowns. I know that they are reliant on venues and I have attempted multiple scenarios, but with no success. Could someone please assist with this and guide me in the right direction. Please see below the code I implemented to get the categories dropdown to work.

    <?php
    $taxonomy = TribeEvents::TAXONOMY;
    $orderby = ‘name’;
    $show_count = 1; // 1 for yes, 0 for no
    $pad_counts = 0; // 1 for yes, 0 for no
    $hierarchical = 1; // 1 for yes, 0 for no
    $title = ”;

    $args = array(
    ‘taxonomy’ => $taxonomy,
    ‘orderby’ => $orderby,
    ‘show_count’ => $show_count,
    ‘hierarchical’ => $hierarchical,
    ‘title_li’ => $title
    );
    ?>

    form code:

    <div class=”categories-container”>
    <?php $cats = get_categories($args); ?>
    <select id=”categories”>
    <option selected value=”” disabled>Event Categories</option>
    <?php foreach ($cats as $cat) : ?>
    <option value=”<?php echo get_term_link($cat, $cat->taxonomy) ?>”><?php echo $cat->name ?></option>
    <?php endforeach; ?>
    </select>
    </div>

    script:

    <script>
    jQuery(document).ready(function()
    {
    jQuery(‘#tribe-bar-form’).submit(function()
    {
    window.location = jQuery(‘#categories’).val();
    return false;
    });
    });
    </script>

    Thanks in advance.

    Kind Regards

    #1616012
    Kyle Anderson
    Guest

    The above code was found through immense amounts of research. I tried to follow the same structure for the city and state/province dropdowns but with no success.

    #1616442
    Sky
    Keymaster

    Hi there,

    Thanks for reaching out. Please note that we do not offer product support or customization help here in the Pre Sales forum. If you have a license for one of our Premium Plugins, you can log in with the email associated with the license, and post these kinds of questions in one of the premium plugin forums.

    Thanks,
    Sky

    #1633789
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Creating events search form on homepage’ is closed to new replies.