Navigation überspringen

[Gelöst] Split: required taxonomy, filters, pagination – move page to specific location after pagination

This support ticket is created vor 1 year, 12 months. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Zeitzone des Unterstützers: Asia/Kolkata (GMT+05:30)

Dieses Thema enthält 6 Antworten, hat 2 Stimmen.

Zuletzt aktualisiert von Minesh vor 1 year, 12 months.

Assistiert von: Minesh.

Author
Artikel
#2704080

This is working now. Thank you. Please open a ticket for the remaining two issues:

2. The second issue is with pagination. This is an elementor site, for reference, and when we click next page button for a "view", I want for it to go to the top of the view on the next page, but instead it goes to random places, sometimes to the bottom of the page.

3. Similarly, for the view, for filters. At times it breaks into two lines. There doesn't seem to be a rhyme or reason. I want it all to stay on the same line. Sometimes it's fine. Other times it loads fine at first and then after a few minutes, it breaks. Other times, it breaks after clicking "next page"

Neue Threads, die von Minesh erstellt wurden und mit diesem verbunden sind, sind unten aufgeführt:

https://toolset.com/de/forums/topic/split-split-required-taxonomy-filters-pagination-3rd-issue/

#2704082

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

To scroll the page at top of the page after pagination - you can use the View's Javascript AJAX event hook "js_event_wpv_pagination_completed":

For example:
- Add the following code to "Custom JS" section of your view:
=>

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.effect (string) The View AJAX pagination effect
    * data.speed (integer) The View AJAX pagination speed in miliseconds
    * data.layout (object) The jQuery object for the View layout wrapper
    */
    jQuery('html, body').animate({ scrollTop: 100 }, 'fast');
 
});

More info:
- https://toolset.com/course-lesson/adding-custom-javascript-to-views-templates-and-archives/#steps-for-adding-javascript-to-a-view
- https://toolset.com/documentation/programmer-reference/adding-custom-javascript-code-to-views-that-use-ajax

I hope above solution will help you to resolve your issue.

#2704088

[deleted]

#2704089

Okay that worked. Would it be possible to get it to go to an anchor point on the page instead? Since it goes all the way to the top, the listings themselves are out of view at first. I can create an anchor ID of #listing

#2704093

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Yes, ok. You can create the element with ID #listing.

I've adjusted the code I shared as given under and change the following line of code:

scrollTop: jQuery("#listing").offset().top

You can use the following code:

jQuery( document ).on( 'js_event_wpv_pagination_completed', function( event, data ) {
    /**
    * data.view_unique_id (string) The View unique ID hash
    * data.effect (string) The View AJAX pagination effect
    * data.speed (integer) The View AJAX pagination speed in miliseconds
    * data.layout (object) The jQuery object for the View layout wrapper
    */
    jQuery('html, body').animate({ scrollTop: jQuery("#listing").offset().top }, 'fast');
  
});
#2704105

Perfect! That worked, thank you. Let me know what you need for the filters issue.

#2704110

Minesh
Unterstützer

Sprachen: Englisch (English )

Zeitzone: Asia/Kolkata (GMT+05:30)

Glad to know that the solution I shared help you to resolve your issue.

You're welcome to mark resolve this ticket and we will use the following split ticket to address your third issue:
- https://toolset.com/forums/topic/split-split-required-taxonomy-filters-pagination-3rd-issue/