How can I place a number of pages on the Next and Previous links?

Home Forums Calendar Products Events Calendar PRO How can I place a number of pages on the Next and Previous links?

Viewing 12 posts - 1 through 12 (of 12 total)
  • Author
    Posts
  • #1085446
    fifteen15studios
    Participant

    Hi Modern Tribe,

    You have Next and Previous buttons to cycle through events (or a collection of events). I’d like to display a number of events found using the certain search criteria. Can we do that? I’d also like to display a list of page groups between the next and previous pages like all other websites do, where we have something to the effect of the following:

    <<First <Previous [1] [2] [3] [4]… [8] Next> Last>>

    Is this possible to add this without a tremendous amount of modification?

    Thanks!
    Brendan

    #1085609
    kortris
    Participant

    i would like this too!

    #1085871
    Brian
    Keymaster

    Hi,

    Thanks for using our plugins. I can help out here.

    We do not have a feature to do numbered pagination and we are limited by our terms and conditions on supporting features outside of what the plugins ship with.

    There are WordPress functions that might help out, but not sure if they will work on a event date based query.

    This is the WordPress function:

    https://codex.wordpress.org/Function_Reference/paginate_links

    And you can modify our templates following our themer’s guide:

    https://theeventscalendar.com/knowledgebase/themers-guide/

    Let me know if you have any follow up questions, but we are limited in providing much more then this.

    Thanks

    #1085927
    fifteen15studios
    Participant

    YES!

    HOLY WOW THAT WORKED!

    THANK YOU FOR THAT! If you want to use this with tribe, just use the variables provided to adjust the page variables setting.

    This is the PHP I used:

    <?php $args = array(
    	'base'               => '%_%',
    	'format'             => '?tribe_paged=%#%'/*
    	'total'              => 1,
    	'current'            => 0,
    	'show_all'           => false,
    	'end_size'           => 1,
    	'mid_size'           => 2,
    	'prev_next'          => true,
    	'prev_text'          => __('« Previous'),
    	'next_text'          => __('Next »'),
    	'type'               => 'plain',
    	'add_args'           => false,
    	'add_fragment'       => '',
    	'before_page_number' => '',
    	'after_page_number'  => ''*/
    ); ?>
    <?php echo paginate_links( $args ); ?>

    I added this to my header, but you can add it just about anywhere. Notice how I commented out the rest of the variables. You can changes these if you want. Yes. Thank you!

    I hope this helps you guys! 🙂

    Now to fine-tune it, add it to my content section, and add some CSS.

    Brendan

    #1086658
    Brian
    Keymaster

    Ok so essentially you used this as the coding:

    <?php $args = array(
    'base' => '%_%',
    'format' => '?tribe_paged=%#%'
    ); ?>
    <?php echo paginate_links( $args ); ?>

    Thanks for sharing!

    #1086873
    kortris
    Participant

    hello, this is a very interesting feature that i was looking for could you please tell me where i ahave to add the code you provide?

    Thank you in advance

    • This reply was modified 8 years, 2 months ago by kortris.
    #1087179
    Brian
    Keymaster

    Hi,

    You can add it to this file here:

    plugins/the-events-calendar/src/views/list/nav.php

    After you move it to your theme here:

    yourtheme/tribe-events/list/nav.php

    Following our themer’s guide:

    https://theeventscalendar.com/knowledgebase/themers-guide/

    From there you would have to style it the way you would like with css.

    Cheers

    #1091195
    Jesse Simmers
    Participant

    This works great if you aren’t using the filters plugin.

    If I go to my main event list page I see that I have 14 pages and pagination works as expected. I then select a filter (I have category and taxonomy filters shown) and the page reloads with the filtered events. I see that the filter modified the URL to include my selections like so:

    /?tribe_paged=1&tribe_event_display=&tribe_eventcategory%5B%5D=36&tribe_tags%5B%5D=5

    I scroll down and see that I now only have 5 pages so it appears to have worked BUT clicking “2” or “Next” takes me to /?tribe_paged=2 which completely removes my filters from the URL.

    If I don’t click “2” or “Next” and just refresh the page it will reload the same page with my filters still in the URL but NOW the pagination links include my filters and work exactly as they should. If I modify my filters I have to go through the process again of refreshing the page for the links in the pagination to include my filters.

    I am thinking this has to do with the AJAX loading since the URLs for the pagination are already set and the filters only update the events shown.

    How would I go about including taxonomies and categories in the pagination URL?

    #1091711
    Brian
    Keymaster

    Hi Jesse,

    I do not have any information to help on this. That is a customization and beyond what we can support.

    I do not even have good information on where to begin on something like this as my first impression is you would have to make a complete custom pagination system to do what you want.

    #1093764
    kortris
    Participant

    So i have to add the code both to the yourtheme/tribe-events/list/nav.php and at plugins/the-events-calendar/src/views/list/nav.php ?

    Thank you in advance

    #1093897
    Brian
    Keymaster

    Hi kortris,

    You want to put the coding only here:

    yourtheme/tribe-events/list/nav.php

    As it will be overwritten in the other location.

    Cheers

    #1094697
    Brian
    Keymaster

    I am going to go ahead and close this thread as we have provided all we can for a customization.

    If you need help on this or something else please post a new ticket.

    Thanks!

Viewing 12 posts - 1 through 12 (of 12 total)
  • The topic ‘How can I place a number of pages on the Next and Previous links?’ is closed to new replies.