Posted: May 1, 2017 at 10:25 am
|
I dont really understand the PHP code EE’s events template files. Could someone help me break down a custom HTML file full of HTML5 elements so that I can fit it into Event Espresso’s events template PHP file? I’ve got an Accordion table using radio buttons containing data tables in each accordion class. These classes use HTML5 elements like inputs and labels to make the table function (along with CSS transitions connected to them). The table also has Registration/RSVP links on the front-end of it. Below is a piece of HTML code of one accordion. So, a little backdrop on this topic: This is our events calendar. My boss wanted to do away with the look of an actual calendar and have something more simple and direct. I know EE has an Accordion template as well, but there are just some specific things we want our Accordion to look, which is all written in just HTML5 and CSS3. This is an example of one accordion class containing a table: <body> <div class=”top”>2016-2017 COURSE SCHEDULE</div> <div class=”akkord”> <div class=”accordion”> <input type=”radio” id=”radio-option-2″ name=”accordion-radios”> <div class=”baffle”> <div class=”baffle-inner”> <tr> <tr> <td> <td> </table> |
Hi Jimmy, Instead of wrapping an events PHP template around the table, you can look into making a PHP page template that’s based on the page.php template of your WordPress theme. Here’s a link to a tutorial that shows how to create a page template in WordPress: http://www.wpbeginner.com/wp-themes/how-to-create-a-custom-page-in-wordpress/ When you are working with a PHP file you can inject html code after closing PHP tag. Then after the html code you add an opening PHP tag. Repeat as needed. Example follows:
|
|
|
Hi Josh, I appreciate your response. Wouldn’t it be a little counter-intuitive to be creating a page template instead of just editing EE’s PHP template? I still want my table to be referencing the events that’s being entered from the WP admin panel and vice versa, and as well as updating registrations, rsvp, payments, etc in real-time. Basically, keep the table connected to the EE system that we use to manage all our events and settings. I’ve taken a look at the index.php file thats located in wp-content > uploads > espresso > templates > events-table folder directory and I see where you can insert table classes and categories. Could I do just that?… insert my own classes and tables into the index.php file? And how would I reference my CSS file in the index file? Also, is there anything that needs to be done to the 3 php files in the templates directory? They are the event_list, event_list_display and payment_page PHP files. |
No. It wouldn’t be counter intuitive because you can use your custom page template to display your events instead of a page with a shortcode on it. Those other templates you’re asking about use shortcodes to display the content on the pages. So instead of wrangling existing code that gets output from a shortcode, then maintaining the code, you’re starting with clean page template that’s better integrated into your theme. So in short, you don’t need to hack up the event_list, event_list_display, and payment_page php files.
If you’re using the shortcode that’s registered by an events table add-on, then sure go for it. |
|
|
If a separate custom page template were to be made then how would it be connected to the events and registration/ticketing system?
|
That’s where adding the PHP code comes in. You can review the built in templates and copy the PHP code from the built in templates into your custom template. |
|
|
Josh, much appreciate the advice you gave me on creating a custom page. However, I am still having a hard time understanding EE template files. How can I extract my current existing event listings php file? The only files I have in my uploads > espresso > template directory are the template files. I’ve also tried looking in the home1 directory and there isnt even an espresso directory in there. |
I can advise against using any files in uploads > espresso > templates. If you want to build out a new view for event lists for Event Espresso 3, you can copy the PHP code from these two files: https://github.com/eventespresso/event-espresso-legacy/blob/master/templates/event_list.php and https://github.com/eventespresso/event-espresso-legacy/blob/master/templates/event_list_display.php |
|
The support post ‘Wrapping events PHP template around custom HTML5 table’ 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.