Support

Home Forums Event Espresso Premium EE3 custome table templete working with FooTable

EE3 custome table templete working with FooTable

Posted: November 12, 2014 at 11:23 pm

Viewing 1 reply thread


PTA Education

November 12, 2014 at 11:23 pm

Hi there,
We finally purchased the EE3(prof) as it has coupon feature which our business will use frequently. However the the default table view from custom template add on doesn’t display the events in a very nice way. So I wanted to implement it with Footable.

Could you please give some guide on if I am doing the right way.

1. I added the following lines in the header.php file in the theme folder

<link href="http://ptacademy.com.au/wp-content/plugins/event-espresso/css/footable.core.css" rel="stylesheet" type="text/css" />
<link href="http://ptacademy.com.au/wp-content/plugins/event-espresso/css/footable.metro.css" rel="stylesheet" type="text/css" />
<link href="http://ptacademy.com.au/wp-content/plugins/event-espresso/css/footable.standalone.css" rel="stylesheet" type="text/css" />
<script src="http://ptacademy.com.au/wp-content/plugins/event-espresso/scripts/footable.js" type="text/javascript"></script>

If it is not the right place to add, please advise the right place to add them

2. I went to the wp-content/plugins/custom-templates/templates/event-table/template.php and change the table class to refer to footable style and include javascript to initialize footable

<script type=”text/javascript”>
$(function () {
$(‘.footable’).footable();
});
</script>

I know probably it is not an appropriate way to achieve what you have for the EE4 custom-template, please do offer some help so that I can achieve the same look as the EE table view.

Thank you in advance for your reply and look forward to a constructive solution!

Patrick


Dean

November 13, 2014 at 2:50 am

Hi,

1) Personally I would use a custom function or two via a Site Specific plugin to register the styles and scripts:
http://codex.wordpress.org/Function_Reference/wp_register_script
http://codex.wordpress.org/Function_Reference/wp_register_style

These can then be loaded as dependencies of jQuery and each other if needed, and you can also load the JavaScript files in the footer (it will help speed up the site a little).

I would also take the files and add them somewhere like the uploads folder, as adding them to EE3’s folder will cause them to be deleted when you update the plugin as they are not native to EE3.

If you want to keep the code in the header.php then at least make sure they run after wp_head() otherwise you’re going to get errors as jQuery most likely won’t have loaded before then.

2) Again, I would look to add this as a separate js file and load it in the footer, as a dependant of jQuery and footable.js.

This means updates wont affect the running of it.

If you need coding assistance, we do have a list of recommended developers here: https://eventespresso.com/developers/event-espresso-pros/ though a service such as Tweakly might be better suited as it’s a smaller job.

Viewing 1 reply thread

The support post ‘EE3 custome table templete working with FooTable’ 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.

Event Espresso