getNextDynamicPage( )
Gets the next dynamic page URL.
Description
The getNextDynamicPage()
function can only be called on a dynamic page
dataset.
The function returns a Promise that is resolved to the relative URL of the
next dynamic page or null
if there is no next page.
The next page is determined by the lexicographical order of the dynamic page relative URLs. You can see all of the relative URLs for a dynamic page by viewing the collection connected to the page.
URLs for items that do not match the dataset's filters are not returned.
For example, consider the following situation:
- You have a collection of employees that contains a boolean field named Active.
- Your dynamic page datset is filtered to only show employees where Active is true.
- Some of your dynamic page URLs include:
- employees/Alice
- employees/Bob
- employees/Cathy
If Bob is not an active employee, when you call getNextDynamicPage()
from Alice's page, the returned Promise will resolve to "employees/Cathy"
.
Pass the returned URL to the to()
function to
navigate to the next dynamic page.
Syntax
function getNextDynamicPage(): Promise<string>
getNextDynamicPage Parameters
This function does not take any parameters.
Returns
Fulfilled - The URL of the next dynamic page, or null
if there is no next page.
Return Type:
Related Content:
Was this helpful?
1$w("#myDataset").getNextDynamicPage()2 .then( (next) => {3 // do something with next page URL4 // URL looks like: "/myCollection/Value"5 } );
1import wixLocationFrontend from 'wix-location-frontend';23$w("#myDataset").getNextDynamicPage()4 .then( (next) => {5 if(next){6 wixLocationFrontend.to(next);7 }8 } );