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
AJ Esamann
2,748 PointsWebsite Building Question
So I own a clothing line and was wondering, for each item I put on my website, when someone clicks that item to view or to checkout, will I need to make a new HTML page for each individual item? Is that the most efficient way?
2 Answers
Jonathan Mitten
Courses Plus Student 11,197 PointsUsing HTML only and no web server, I'm afraid so. There are exceptions to this rule, like using a JavaScript library like AngularJS, but again, that's not simply HTML. You're looking for a templating structure, it sounds like, where you'd have a template for a product line, and then a specific object (details about your product) that would be loaded in from some type of database or data store. Creating HTML-only catalogues - unless we're talking just 5-10 items - would be inefficient in the long term. Once you're done with HTML, check out the PHP courses for information on server-side includes, dynamic content, SQL databases, etc.
andren
28,558 PointsWith pure static HTML yes, but It's certainly not the most efficient way, and not how any big website operates these days.
Most businesses use dynamic pages, meaning that they have some server code that runs when you request a webpage that can pull out information from a database and format a page based on that.
So you could design a webpage template that can display data from any shirt, and then just have the server populate it with info from the correct shirt as it is being requested, the server can determine what shirt is being requested based on the URL or something similar.
Designing something like that requires not only knowledge of HTML, but also of some server-side language and some knowledge with a database system.
There are tons of databases and tons of server-side languages available, you can use PHP, Python, Ruby, Java, JavaScript and other languages like that on a server. How you use them on a server differs a bit from language to language. Treehouse has courses for using most of these languages for web development. So regardless of which one you choose to use you should be able to find some help here on Treehouse.