Python for Entrepreneurs Transcripts
Chapter: Build web apps with Pyramid: Applied web development
Lecture: Concept: Shared layout (motivation)

Login or purchase this course to watch this video and the rest of the course contents.
0:02 Let's talk about layout and a common look and feel.
0:06 Obviously, we would like to have one place to maintain
0:09 the look and feel of our application,
0:11 we'd like to have the overall look and feel of the site easily adapted
0:15 and brought into every single page that we create
0:18 and if we had a new page, we want to be able to do that super easily
0:22 as well as if we want to make changes like
0:24 here I have a little "brought to you by H I R E D" thing on my podcast,
0:28 what if I want to change that? I'd like to be able to change that in one place
0:31 and have everything just take that look and feel,
0:34 what if I want to switch it to a whiteish rather than a dark colored site;
0:37 I want to be able to do that in one place, similar with navigation, everything.
0:41 The mechanism by which we accomplish this is shared layout.
0:45 And I want to point out while it's most obvious that
0:48 this is about the look and feel of our site, there is more to it than that,
0:51 a modern web application is very important to have the same
0:55 consistent information in all of our site, things like what is the fav icon,
1:00 what is the description, is there an RSS feed, where is it,
1:03 all that kind of stuff is important.
1:06 It's very important that we consistently bring CSS files
1:10 all the CSS files in the right order into the page,
1:13 it's also important to bring the right JavaScript files into the page and again, in the right order.
1:18 Of course we want to do this in one place, so we want to make a change it flows through,
1:21 but it's also just very important to know
1:24 that we are controlling that absolutely consistently across our site.
1:27 We want to have consistent analytics, so we might have Google analytics,
1:32 maybe Facebook pixels for trying to do Facebook ads,
1:36 and we want to track conversions,
1:38 all those kinds of things you again want to be able to put that in a shared layout
1:42 and have that flow or change throughout your site all at once
1:46 we also want to have structured ways for the individual pages
1:49 to bring in additional CSS and JavaScript.
1:53 For example maybe you've got some page
1:54 that is kind of a single page app thing and you want to bring in AngularJS,
1:58 you'd like to have a way for that an individual page
2:02 to consistently bring in the additional JavaScript and CSS that it's going to need,
2:06 and weave that into your overall look and feel and JavaScript ordering and so on,
2:11 and we can use our shared layout to control this aspect as well.