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. Obviously, we would like to have one place to maintain the look and feel of our application,
0:12 we'd like to have the overall look and feel of the site easily adapted and brought into every single page that we create
0:19 and if we had a new page, we want to be able to do that super easily as well as if we want to make changes like
0:25 here I have a little "brought to you by H I R E D" thing on my podcast, what if I want to change that? I'd like to be able to change that in one place
0:32 and have everything just take that look and feel, what if I want to switch it to a whiteish rather than a dark colored site;
0:38 I want to be able to do that in one place, similar with navigation, everything. The mechanism by which we accomplish this is shared layout.
0:46 And I want to point out while it's most obvious that this is about the look and feel of our site, there is more to it than that,
0:52 a modern web application is very important to have the same consistent information in all of our site, things like what is the fav icon,
1:01 what is the description, is there an RSS feed, where is it, all that kind of stuff is important.
1:07 It's very important that we consistently bring CSS files all the CSS files in the right order into the page,
1:14 it's also important to bring the right JavaScript files into the page and again, in the right order.
1:19 Of course we want to do this in one place, so we want to make a change it flows through, but it's also just very important to know
1:25 that we are controlling that absolutely consistently across our site. We want to have consistent analytics, so we might have Google analytics,
1:33 maybe Facebook pixels for trying to do Facebook ads, and we want to track conversions,
1:39 all those kinds of things you again want to be able to put that in a shared layout and have that flow or change throughout your site all at once
1:47 we also want to have structured ways for the individual pages to bring in additional CSS and JavaScript. For example maybe you've got some page
1:55 that is kind of a single page app thing and you want to bring in AngularJS, you'd like to have a way for that an individual page
2:03 to consistently bring in the additional JavaScript and CSS that it's going to need,
2:07 and weave that into your overall look and feel and JavaScript ordering and so on, and we can use our shared layout to control this aspect as well.


Talk Python's Mastodon Michael Kennedy's Mastodon