Sign in to follow this  
tooth-paste

Adding page numbering

Recommended Posts

Hi,

How can I combine these two scripts to add pagination and show 10 items max?

$items = $page->portal_bestanden;
foreach ($items as $item) {
	$name = str_replace("_", " ", $item->name);
		echo '<div class="row" style="padding:7px 0 5px 0">
		<div class="col-md-6">
		<a href="'. $item->url .'">'. $name .'</a><br />
		</div>
		<div class="col-md-2">
		'. $item->filesizeStr .'<br />
		</div>
		<div class="col-md-4">
		'. $item->description .'<br />
		</div>
		</div>
		<div class="row">
		<div class="col-md-12 lijn">
		<div class="lijn"></div>
		</div>
		</div>';
												
		}

and

$pagination = $items->renderPager(array(
		'nextItemLabel' => "Volgende",
		'previousItemLabel' => "Vorige"
	));
echo $pagination;

 

Share this post


Link to post
Share on other sites

Hi tandpasta,

The pagination workings of ProcessWire are really well documented. Based on your fieldname (bestanden) you are not using pages but a file field? Not sure if this is possible, it might.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.