top of page

Loop Next & Previous Buttons on Dynamic Pages



Velo Code:


import {local} from 'wix-storage';

const linkField = "link-team-title"; // replace this value

$w.onReady(function () {
  $w("#teamDataset").onReady(() => {
    const numberOfItems = $w("#teamDataset").getTotalCount();
  
    $w("#teamDataset").getItems(0, numberOfItems)
      .then( (result) => { 
        const dynamicPageURLs = result.items.map(item => item[linkField]);
        local.setItem('dynamicPageURLs', dynamicPageURLs);
      } )
      .catch( (err) => {
        console.log(err.code, err.message);
      } );
  } );
} );

Enjoy!

bottom of page