{"id":1617059,"date":"2018-09-09T07:22:37","date_gmt":"2018-09-09T14:22:37","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/"},"modified":"2018-10-01T16:56:11","modified_gmt":"2018-10-01T23:56:11","slug":"creating-events-search-form-on-homepage-2","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/","title":{"rendered":"Creating events search form on homepage"},"content":{"rendered":"<p>Hi,<\/p>\n<p>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.<br \/>\nEssentially I need three fields (Categories, City and Province\/State) with a submit button, naturally.<\/p>\n<p>I have managed to generate the submit button and a categories dropdown which works perfectly, however I can\u2019t 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 that was implemented to get the categories dropdown to work. I have attempted to use the same structure of code used for categories and declare the information specific to city and states eg. ($searched_meta = &#8216;_VenueCity&#8217;; $relation_meta = &#8216;_EventVenueID&#8217;; $join_name = &#8216;city_filter&#8217;;), and call it into the input field to generate the necessary information but with no success. I think I need to communicate with base_meta.php in order to get the relevant information but I am not 100% sure. Any assistance will be greatly appreciated.<\/p>\n<p>&lt;?php<br \/>\n$taxonomy = TribeEvents::TAXONOMY;<br \/>\n$orderby = \u2018name\u2019;<br \/>\n$show_count = 1; \/\/ 1 for yes, 0 for no<br \/>\n$pad_counts = 0; \/\/ 1 for yes, 0 for no<br \/>\n$hierarchical = 1; \/\/ 1 for yes, 0 for no<br \/>\n$title = \u201d;<\/p>\n<p>$args = array(<br \/>\n\u2018taxonomy\u2019 =&gt; $taxonomy,<br \/>\n\u2018orderby\u2019 =&gt; $orderby,<br \/>\n\u2018show_count\u2019 =&gt; $show_count,<br \/>\n\u2018hierarchical\u2019 =&gt; $hierarchical,<br \/>\n\u2018title_li\u2019 =&gt; $title<br \/>\n);<br \/>\n?&gt;<\/p>\n<p>form code:<\/p>\n<p>&lt;div class=\u201dcategories-container\u201d&gt;<br \/>\n&lt;?php $cats = get_categories($args); ?&gt;<br \/>\n&lt;select id=\u201dcategories\u201d&gt;<br \/>\n&lt;option selected value=\u201d\u201d disabled&gt;Event Categories&lt;\/option&gt;<br \/>\n&lt;?php foreach ($cats as $cat) : ?&gt;<br \/>\n&lt;option value=\u201d&lt;?php echo get_term_link($cat, $cat-&gt;taxonomy) ?&gt;\u201d&gt;&lt;?php echo $cat-&gt;name ?&gt;&lt;\/option&gt;<br \/>\n&lt;?php endforeach; ?&gt;<br \/>\n&lt;\/select&gt;<br \/>\n&lt;\/div&gt;<\/p>\n<p>script:<\/p>\n<p>&lt;script&gt;<br \/>\njQuery(document).ready(function()<br \/>\n{<br \/>\njQuery(\u2018#tribe-bar-form\u2019).submit(function()<br \/>\n{<br \/>\nwindow.location = jQuery(\u2018#categories\u2019).val();<br \/>\nreturn false;<br \/>\n});<br \/>\n});<br \/>\n&lt;\/script&gt;<\/p>\n<p>Thanks in advance.<\/p>\n<p>Kind Regards<\/p>\n","protected":false},"template":"","class_list":["post-1617059","topic","type-topic","status-closed","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Creating events search form on homepage -<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating events search form on homepage -\" \/>\n<meta property=\"og:description\" content=\"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. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/\" \/>\n<meta property=\"article:modified_time\" content=\"2018-10-01T23:56:11+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/\",\"name\":\"Creating events search form on homepage -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2018-09-09T14:22:37+00:00\",\"dateModified\":\"2018-10-01T23:56:11+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/theeventscalendar.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\/\/theeventscalendar.com\/support\/topics\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Calendar Products\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Filter Bar\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/filter-bar\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Creating events search form on homepage\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\",\"url\":\"https:\/\/theeventscalendar.com\/support\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating events search form on homepage -","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/","og_locale":"en_US","og_type":"article","og_title":"Creating events search form on homepage -","og_description":"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. [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/","article_modified_time":"2018-10-01T23:56:11+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/","name":"Creating events search form on homepage -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2018-09-09T14:22:37+00:00","dateModified":"2018-10-01T23:56:11+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/creating-events-search-form-on-homepage-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/theeventscalendar.com\/support\/"},{"@type":"ListItem","position":2,"name":"Topics","item":"https:\/\/theeventscalendar.com\/support\/topics\/"},{"@type":"ListItem","position":3,"name":"Calendar Products","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/"},{"@type":"ListItem","position":4,"name":"Filter Bar","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/filter-bar\/"},{"@type":"ListItem","position":5,"name":"Creating events search form on homepage"}]},{"@type":"WebSite","@id":"https:\/\/theeventscalendar.com\/support\/#website","url":"https:\/\/theeventscalendar.com\/support\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/theeventscalendar.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1617059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":1,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1617059\/revisions"}],"predecessor-version":[{"id":1635008,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1617059\/revisions\/1635008"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1617059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}