Support

Home Forums Event Espresso Premium Pagination @ [ESPRESSO_EVENTS_TABLE_TEMPLATE]

Pagination @ [ESPRESSO_EVENTS_TABLE_TEMPLATE]

Posted: June 14, 2016 at 8:06 am


SapphireBSL

June 14, 2016 at 8:06 am

Hello

I cannot get the pagination to work with the [ESPRESSO_EVENTS_TABLE_TEMPLATE].

I have tried [ESPRESSO_EVENTS_TABLE_TEMPLATE table_pages=5] and [ESPRESSO_EVENTS_TABLE_TEMPLATE table_paging=true table_pages=5] to no avail.

Do you have any suggestions please?

<?php echo do_shortcode(‘ [ESPRESSO_EVENTS_TABLE_TEMPLATE table_pages=5]’); ?>
is what is used currently at
https://www.sapphireqhse.co.uk/public_courses


Lorenzo Orlando Caum

  • Support Staff

June 14, 2016 at 8:54 am

Hello,

Is your goal is to show 5 events and then paginate additional events?

If so, try this:

[ESPRESSO_EVENTS_TABLE_TEMPLATE table_pages=5 limit=50]


Lorenzo


SapphireBSL

June 14, 2016 at 8:58 am

Hi Lorenzo

Thanks for the feedback. That does not seem to work it just limits the number of events displayed to 5 with no pagination.

It is in the code now so you can see it https://www.sapphireqhse.co.uk/public_courses

Would that solution you have provided also limit the number of pages? which is not a desired outcome (I would like to show all events just with pagination).

Thanks


SapphireBSL

June 14, 2016 at 4:43 pm

Any ideas?


Lorenzo Orlando Caum

  • Support Staff

June 15, 2016 at 8:12 am

Hello,

I made an error on that shortcode, the values should be switched like this:

[ESPRESSO_EVENTS_TABLE_TEMPLATE table_pages=5 limit=50]

It will then show 5 at a time and then paginate up to 50 events in total.

Feel free to adjust as needed.


Lorenzo


SapphireBSL

June 15, 2016 at 8:18 am

Hi Lorenzo

That did not work, it just made the page show all events.

I have left the code as per your last message so the result can be seen at https://www.sapphireqhse.co.uk/public_courses

???
Thanks


Tony

  • Support Staff

June 15, 2016 at 8:32 am

If you use [ESPRESSO_EVENTS_TABLE_TEMPLATE table_pages=5] within a page rather than using do_shortcode() does it work then?

Note – you should not need to set a limit value unless you want fewer events.


SapphireBSL

June 20, 2016 at 8:30 am

Hi I have tried it without do_shortcode() and it still does not work 🙁


Tony

  • Support Staff

June 21, 2016 at 5:19 am

You placed [ESPRESSO_EVENTS_TABLE_TEMPLATE table_pages=5] within a completely separate page and got the same results there? (Note that creating a page with the slug public_courses does not actually replace the current output, /public_courses/ is the EE slug and will display an archive of events regardless of your pages)

So the problem is that [ESPRESSO_EVENTS_TABLE_TEMPLATE] shortcodes expects to run within the_content and is set up to enqueue it’s scripts during that call.

As your running do_shortcode() within the templates its running later than expected and isn’t enqueuing the JS needed for the pagination.

You can work around that by adding:

if ( class_exists( 'EES_Espresso_Events_Table_Template' ) ) {
	add_action( 'wp_enqueue_scripts', array( EES_Espresso_Events_Table_Template::instance(), 'enqueue_scripts' ) );
}

To the top of the archive template you are currently using, this must be placed before the call to get_header() or wp_head() depending on how your theme is set up.

The support post ‘Pagination @ [ESPRESSO_EVENTS_TABLE_TEMPLATE]’ 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.

Support forum for Event Espresso 3 and Event Espresso 4.
Documentation for EE3 and EE4
Documentation for Event Espresso 3

Documentation for Event Espresso 4

Status: closed

Updated by  Tony 3 years, 4 months ago ago

Topic Tags

Notifications

This topic is: not resolved
Do NOT follow this link or you will be banned from the site!
[for="input_96_5_3"]
[for="input_96_5_3"]
[gravityform id=96 title=false description=false]
  • This field is for validation purposes and should be left unchanged.
[i]
[i]
[gravityform id=69 title=false description=false]
  • This field is for validation purposes and should be left unchanged.