{"id":1364097,"date":"2017-10-16T06:16:01","date_gmt":"2017-10-16T13:16:01","guid":{"rendered":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/"},"modified":"2017-10-16T06:19:54","modified_gmt":"2017-10-16T13:19:54","slug":"acf_form-on-month-week-and-single-views","status":"closed","type":"topic","link":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/","title":{"rendered":"acf_form on Month, Week and Single Views"},"content":{"rendered":"<p>Hello, I&#8217;m working on a new feature which embeds an <a href=\"https:\/\/www.advancedcustomfields.com\/resources\/acf_form\/\" rel=\"noopener\" target=\"_blank\">Advanced Custom Fields form (acf_form)<\/a> for each event on the Month and Week view as well as the event detail page. The form works great on the detail page and Week view but not on the Month view. <\/p>\n<p><strong>This same acf_form is in Week and Month:<\/strong> (\/tribe-events\/week\/single-event.php, \/tribe-events\/month\/single-event.php)<\/p>\n<pre><code>\n&lt;div id=&quot;tribe-events-event-&lt;?php echo esc_attr( $event_id ); ?&gt;&quot; class=&quot;&lt;?php tribe_events_event_classes() ?&gt;&quot; data-tribejson=&#039;&lt;?php echo esc_attr( tribe_events_template_data( $post ) ); ?&gt;&#039;&gt;\n\t&lt;h3 class=&quot;tribe-events-month-event-title &lt;?php echo esc_attr( $event_id ); ?&gt;&quot;&gt;&lt;a href=&quot;&lt;?php echo esc_url( $link ) ?&gt;&quot; class=&quot;url&quot;&gt;&lt;?php echo $title ?&gt;&lt;\/a&gt;&lt;\/h3&gt;\n\t&lt;?php acf_form(array(\n\t\t\/\/&#039;post_id&#039; =&gt; &#039;new_post&#039;,\n\t\t&#039;new_post&#039; =&gt; false,\n\t\t&#039;post_title&#039; =&gt; false,\n\t\t&#039;post_content&#039; =&gt; false,\n\t\t&#039;field_groups&#039; =&gt; array(5636),\n\t\t&#039;uploader&#039; =&gt; &#039;basic&#039;,\n\t\t&#039;html_submit_spinner&#039; =&gt; &#039;&lt;span class=&quot;acf-spinner&quot;&gt;&lt;\/span&gt;&#039;,\n\t\t&#039;updated_message&#039; =&gt; __(&quot;Attendance has been updated!&quot;, &#039;acf&#039;),\n\t\t&#039;submit_value&#039; =&gt; &#039;Update&#039;\n\t)); ?&gt;\n&lt;\/div&gt;&lt;!-- #tribe-events-event-# --&gt;\n<\/code><\/pre>\n<p>I also confirmed that acf_form_head() is present in both views via the default-template.php file.<\/p>\n<p>I&#8217;m not sure what is different about the Month view compared to Week. The form updates a repeater field successfully on the Week view but on the Month view I just get scrolled to the top of the page like an anchor tag. The main difference I see in the 2 single-event.php templates is that in the month\/single-event.php the $event_id variable is specified but the week\/single-event.php does not.<\/p>\n<pre><code>\n$day      = tribe_events_get_current_month_day();\n$event_id = &quot;{$post-&gt;ID}-{$day[&#039;daynum&#039;]}&quot;;\n$link     = tribe_get_event_link( $post );\n$title    = get_the_title( $post );\n<\/code><\/pre>\n<p>I tried specifying &#8216;post_id&#8217; =&gt; $post-&gt;ID, and &#8216;post_id&#8217; =&gt; $post, as tests but this didn&#8217;t work. Can anyone shine any light on this and let me know what&#8217;s different about these 2 templates and what we can do to solve this for the Month view? Any insight is appreciated!<\/p>\n","protected":false},"template":"","class_list":["post-1364097","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>acf_form on Month, Week and Single Views -<\/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\/acf_form-on-month-week-and-single-views\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"acf_form on Month, Week and Single Views -\" \/>\n<meta property=\"og:description\" content=\"Hello, I&#8217;m working on a new feature which embeds an Advanced Custom Fields form (acf_form) for each event on the Month and Week view as well as the event detail page. The form works great on the detail page and Week view but not on the Month view. This same acf_form is in Week and [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/\" \/>\n<meta property=\"article:modified_time\" content=\"2017-10-16T13:19:54+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\/acf_form-on-month-week-and-single-views\/\",\"url\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/\",\"name\":\"acf_form on Month, Week and Single Views -\",\"isPartOf\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/#website\"},\"datePublished\":\"2017-10-16T13:16:01+00:00\",\"dateModified\":\"2017-10-16T13:19:54+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/#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\":\"Events Calendar PRO\",\"item\":\"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"acf_form on Month, Week and Single Views\"}]},{\"@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":"acf_form on Month, Week and Single Views -","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\/acf_form-on-month-week-and-single-views\/","og_locale":"en_US","og_type":"article","og_title":"acf_form on Month, Week and Single Views -","og_description":"Hello, I&#8217;m working on a new feature which embeds an Advanced Custom Fields form (acf_form) for each event on the Month and Week view as well as the event detail page. The form works great on the detail page and Week view but not on the Month view. This same acf_form is in Week and [&hellip;]","og_url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/","article_modified_time":"2017-10-16T13:19:54+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\/acf_form-on-month-week-and-single-views\/","url":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/","name":"acf_form on Month, Week and Single Views -","isPartOf":{"@id":"https:\/\/theeventscalendar.com\/support\/#website"},"datePublished":"2017-10-16T13:16:01+00:00","dateModified":"2017-10-16T13:19:54+00:00","breadcrumb":{"@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/theeventscalendar.com\/support\/forums\/topic\/acf_form-on-month-week-and-single-views\/#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":"Events Calendar PRO","item":"https:\/\/theeventscalendar.com\/support\/forums\/forum\/events\/events-calendar-pro\/"},{"@type":"ListItem","position":5,"name":"acf_form on Month, Week and Single Views"}]},{"@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\/1364097","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":0,"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/topic\/1364097\/revisions"}],"wp:attachment":[{"href":"https:\/\/theeventscalendar.com\/support\/wp-json\/wp\/v2\/media?parent=1364097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}