Posted: March 28, 2014 at 5:55 pm
|
Hey all. I have purchased EE3 and have the custom files and custom templates add-ons. I have written a custom view for the event list called “Mindframe” and, to test it, I created a new page using the default wordpress page template and tested it out using the following short code: [EVENT_CUSTOM_VIEW template_name=”mindframe” category_identifier=”course-lego-mindstorms-kids”] Everything worked fine and displayed exactly as I would have expected it to. For reference, a working URL is http://www.mindframeeducation.com/event-list-test/ I went to add this into a custom page template (part of a child theme that I Developed) and, using the exact same shortcode, I get the error message “the custom template mindframe can not be found”. (http://www.mindframeeducation.com/adventures-in-robotics-using-lego-mindstorms/) I have dropped the template folder and files (mindframe/index.php) into just about every single directory imaginable and still cannot figure out why it is breaking. For reference, I have tried the following locations: / I even tried to just overwrite the ‘events-table’ index.php with my code, and somehow that didn’t work as expected either. My code is <code><?php //Template: Mindframe //Description: This template is used in the Mindframe WordPress Template to display all events in a selected category //Shortcode Example: [EVENT_CUSTOM_VIEW template_name="mindframe"] //The end of the action name (example: "action_hook_espresso_custom_template_") should match the name of the template. In this example, the last part the action name is "default", add_action('action_hook_espresso_custom_template_mindframe','espresso_custom_template_mindframe'); function espresso_custom_template_mindframe(){ global $this_event_id, $events, $wpdb; //Get the categories $sql = "SELECT * FROM " . EVENTS_CATEGORY_TABLE; $temp_cats = $wpdb->get_results($sql); ?> <table class="ee-mf-course-availability"> <?php foreach ($events as $event){ $button_text = __('Register', 'event_espresso'); $alt_button_text = __('View Details', 'event_espresso');//For alternate registration pages $externalURL = $event->externalURL; $button_text = !empty($externalURL) ? $alt_button_text : $button_text; $registration_url = !empty($externalURL) ? $externalURL : espresso_reg_url($event->id); if ( ! has_filter( 'filter_hook_espresso_get_num_available_spaces' ) ){ $open_spots = apply_filters('filter_hook_espresso_get_num_available_spaces', $event->id); //Available in 3.1.37 }else{ $open_spots = get_number_of_attendees_reg_limit($event->id, 'number_available_spaces'); } $live_button = '<a id="a_register_link-'.$event->id.'" href="'.$registration_url.'">'.$button_text.'</a>'; $event_status = event_espresso_get_status($event->id); //Check for Multi Event Registration $multi_reg = false; if (function_exists('event_espresso_multi_reg_init')) { $multi_reg = true; } $cart_link = ''; //Create an add to cart link if ($multi_reg && $event_status == 'ACTIVE' && empty($externalURL)) { $params = array( //REQUIRED, the id of the event that needs to be added to the cart 'event_id' => $event->id, //REQUIRED, Anchor of the link, can use text or image 'anchor' => __("Add to Cart", 'event_espresso'), //'anchor' => '<img src="' . EVENT_ESPRESSO_PLUGINFULLURL . 'images/cart_add.png" />', //REQUIRED, if not available at this point, use the next line before this array declaration // $event_name = get_event_field('event_name', EVENTS_DETAIL_TABLE, ' WHERE id = ' . $event_id); 'event_name' => $event->event_name, //OPTIONAL, will place this term before the link 'separator' => ' '.__("or", 'event_espresso').' ' ); $cart_link = event_espresso_cart_link($params); } if($open_spots < 1 && $event->allow_overflow == 'N') { $live_button = __('Sold Out', 'event_espresso'); $cart_link = ''; } else if ($open_spots < 1 && $event->allow_overflow == 'Y'){ $live_button = !empty($event->overflow_event_id) ? '<a href="'.espresso_reg_url($event->overflow_event_id).'">'.__('Join Waiting List', 'event_espresso').'</a>' : __('Sold Out', 'event_espresso'); $cart_link = ''; } if ($event_status == 'NOT_ACTIVE') { $live_button = __('Closed', 'event_espresso'); $cart_link = ''; } ?> <tr> <td id="start_date-<?php echo $event->id?>" class="start_date"><?php echo event_date_display($event->start_date) ?> - <?php echo event_date_display($event->end_date) ?></td> <td class="td-group reg-col" nowrap="nowrap"><?php echo $event_status == 'ACTIVE' ? $live_button . $cart_link : $live_button; ?></td> </tr> <?php } //close foreach ?> </table> <?php }</code> Any help would be greatly appreciated. I am pulling my hair out. |
The support post ‘Problems with Custom Templates Location’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.