Adding a CMS to Your Pyramid Web App Transcripts
Chapter: Advanced Markdown templates
Lecture: Using shared-content, first pass

Login or purchase this course to watch this video and the rest of the course contents.
0:00 Now let's see about using some of this.
0:03 Shared a reasonable content basically extending marked down, as is understood by this marked on sub template thing.
0:09 If we come over here and let's just say, problem page something to that effect and to maybe we want to be able to let somebody cover and on the bottom of all these pages were right and say, Do you see a problem with this page?
0:26 Send us a message or something like that, Right. So let's go over here and we'll just write that shared content.
0:31 So what we're gonna dio as we're gonna put a maybe, each four. It would be something like, See a problem.
0:47 So here's some basic text, and then let's even make this. Ah, hyperlink.
0:51 So we come over here and put this is a link and the link is going to be H p s twitter dot com slash the psf except looks good.
1:02 Maybe there's a space there. All right, cool. Let's give it a quick preview. It looks good. They go to the right place.
1:11 May the Python suffer foundation. Good, Good. All right. So it looks like this is fine. Let's go and just save it.
1:17 Now, let's suppose this our team and company history and maybe even the donate, but they all want to have this little section down at the bottom.
1:26 Are we gonna do that? Well, now that this is in our database, it's super easy. If we go edit this, donate one down here.
1:32 All we have to do is say, import the name of the little short girl it could even have.
1:38 Slash is like this if that's what the Ural is, and then you could have stuff more after this if you want not gonna put that there.
1:46 But if it made sense to put this in the middle of the page, it totally what's Let me copy this and save it. Now let's see that that shows up.
1:54 Hit, visit, Boom. Look at that. Now. We might want us to be smaller, maybe centred and gray or something like that.
2:02 We couldn't address that in a second, but that's pretty cool, right? And let's go back to the admin and put it in one more place.
2:10 Go put us in the bottom of the company here and in the bottom of our team. There Now, if we go look at all these. Look at these three pages.
2:20 They all have the same bit right there. Isn't that cool? So allows us to create little fragments.
2:25 Now, what I don't like we're going to fix later is this page looks no different than these top level pages that are basically making up our site.
2:35 So what I want to do is have a different section that shows thes shared things. We need to have a way to indicate in the database.
2:42 This is a shared, reasonable piece. You shouldn't treated the same. So we're going to do that.
2:47 But for now, let's just go and sort of see and appreciate how cool this is.
2:51 All we got to do is write these little import statements which normal markdown doesn't support. But our library


Talk Python's Mastodon Michael Kennedy's Mastodon