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

HTML

Branko Zivanovic
Branko Zivanovic
2,684 Points

HTML preprocessors and partials

Hey everone! At the moment, I'm working at my very first BIG project.Lately all I've been doing, were simple static web pages, but these days I'm looking for environment that is going to give me easy time when maintaining stuff.I'm using SASS with SMACSS and my CSS is organized, but my HTML is literally huge.Is there any way to break that document in smaller partials, like I would do with SASS partials? Thanks

2 Answers

Roy Penrod
Roy Penrod
19,810 Points

Good list, Dustin. Thanks for putting it together.

Roy Penrod
Roy Penrod
19,810 Points

On the modern web, you usually do that within a framework that uses the Model-View-Controller (MVC) design pattern.

Basically, you use a template language to create "views" consisting of partial HTML files and then inject data into them.

If you know PHP, check out the Building Websites With PHP course. It shows a simple project using the Slim framework with the Twig template language.

Branko Zivanovic
Branko Zivanovic
2,684 Points

Okay, sounds like I'm going to dive into the PHP. Thank you

Roy Penrod
Roy Penrod
19,810 Points

You don't necessarily have to do it with PHP. You could use any back-end programming language, including JavaScript.

You need to do it on the server because the browser needs the document to render it.