Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

PHP Custom Pagination

First, I'm already thankful for what I learned. Thanks Treehouse and thanks Randy Hoyt <3

Second, I want to implement some sort of pagination where the user would be able to view more shirts, considered that I have a table in database holding all the information about the shirt.

Here is a screenshot to show you exactly here

Third, any good articles on how to attach Facebook's social plugin to comment and like shirts?

Thanks a lot. Appreciated :)

2 Answers

Nick Pettit
STAFF
Nick Pettit
Treehouse Teacher

Hey Seif Sayed,

I rehosted your image on imgur.com and embedded it here for easier viewing.

Shirts for Mike site

Pagination is actually surprisingly complex. It's typical for a developer to use something that's already written to implement this particular feature. Randy Hoyt, our PHP teacher at Treehouse, may have some good suggestions for you.

Randy Hoyt
STAFF
Randy Hoyt
Treehouse Guest Teacher

Later in the current project, we'll be displaying 8 shirts per page and then adding links to page 2, page 3, and page 4. Those videos should be out in a month or so. But it sounds like you are wanting something a little different than that. I think the feature you want is called "infinite scrolling." There is a jQuery plugin to do that, but you need a server-side data source to go along with it. I plan to cover how to write an AJAX web service in PHP in a future tutorial, and I might consider covering something like this.