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

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.