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.

JavaScript Express Basics (2015) Using Templates with Express Scaffolding Your Project’s Templates - adding “partials”

jsdevtom
jsdevtom
16,963 Points

What does block content do again?

I've read this, but I still don't get what it does or why.

The "block [something]" command is simply a way to connect the two pages and provide the location for the text. The "content" is just a logical label to use; could just as well be "body", "main", etc.

jsdevtom
jsdevtom
16,963 Points

Gregory Katchmar, thanks for your answer. Could you tell me, to what the block content command is referring to in this video please?

From the prior video, "Scaffolding Your Project’s Templates", at 4:06: "The final thing I need in my layout file, are the block content key words. This lets jade know that any page extending the layout, can inject its HTML here". The content exists in the "layout" file and it is being injected into both the "post" and the "index" pages where the "block content" command exists. Hope this helps; it's a tricky topic, especially as no Workspaces are being used to keep a good record of all of this.