简体   繁体   中英

Getting a ajax pagination values in Drupal custom module?

I have slideshow page comes from view

Page URL: http://localhost.com/entertainment/word

In this page i have slideshow that have prev and next button..

When i press next button, it calls views ajax and goes to next slide by append ?page=2 then URL becomes " http://localhost.com/entertainment/word?page=2 " without page refresh .

After every ajax call i need to get the appended value like page="2" in custom module.

由于它是ajax调用,我想您应该使用JS获得页面值。

    document.URL.split("page=")[1]

If you need to retrieve the active page within a module (server-side), you can make use of the pager_find_page function.

This will return an integer of the active page based on the page querystring parameter.

I have done with Sessions.

Got nid in the view page and assigned to seesion variable.

get that session variable in .module file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM