Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

General Discussion

Richard Contreras
Richard Contreras
7,026 Points

What languages/skills do I need to learn to build an interactive directory for my website?

I am building a website that is a directory of merchants. It's pretty simple: name of merchant, website link, brief description, and a category.

Besides, HTML and CSS, what are concepts I need to learn in order to sort these merchants into an interactive directory? Something where the user could sort the merchants alphabetically or by category. I'd also like the user to be able to jump to the last page of search results (e.g., if I had 1000 merchants whose name start with K, and I'm listing 25 merchants per page, I'm thinking the user would have something like this as an option: < 1 2 3 ... LAST >).

I'm not asking for specific lines of codes or plug-ins. Much broader. Something like, "Learn SQL and these concepts from it." Is SQL the best way to build this sort of directory?

1 Answer

Brendon Butler
Brendon Butler
4,254 Points

There are a few ways that I can think of that you can accomplish this. I would say that PHP or Javascript would be the easiest way to do this. And for each page you would use a system called pagination.

There are all kinds of data storage types you can use such as SQL, JSON, and some others. I added a couple links for each PHP (using SQL) and Javascript (using JSON). They are interchangeable and you can even have Javascript in your PHP.

I would recommend going through the PHP and Javascript courses to learn those (as you will probably eventually want to learn those anyways).

PHP pagination with SQL

Javascript pagination with JSON