I'm trying to build a fairly simple site as an intro to processwire. Currently on my to-do list is to have an "our customers" page with a list of testimonials, and also to have a random testimonial snippet picked from this list in a sidebar on various other pages.
So, I created a repeater field "testimonials" comprising testimonial_body, testimonial_summary and testimonial_name (the testimonial_summary is just a few choice words for the sidebar). Created a template "testimonial_list.php" and assigned the testimonials repeater field to it then made a page "our-customers" and gave it the template "testimonial_list".
So, I've got an /our-customers/ page that lists the testimonials:
foreach($page->testimonials as $testimonial) {
echo "<blockquote><p>{$testimonial->testimonial_body}</p>";
echo "<small>{$testimonial->testimonial_customer}</small></blockquote> ";
echo "<hr>";
}
All good so far, but now I'd like to add pagination. However, after reading the selectors and pagination API docs I'm afraid I have no idea how to proceed.
Should I even be using repeater fields for this? They weren't enabled by default so I'm thinking perhaps I should be using a separate page for each testimonial. I'm having a hard time figuring out how pages, templates, fields relate to each other.