Adding a CMS to Your Flask Web App Transcripts
Chapter: Advanced markdown
Lecture: Visualizing shared pages
0:00 we're finally ready to make our admin section do what we've been setting out to do for a while to break these into two sections,
0:08 the shared stuff and the not shared stuff. So over here, right now, we're just saying show us all the pages and then we're gonna drop out these little
0:17 list items like so what we're gonna do don't have to section who have pages and or have called shared was called Shared on.
0:27 I guess we could update this. These are gonna be the pages that are just what we've been working with for so
0:36 long. And then these are gonna be the ones that are shared. I'm gonna set a class to be shared page because that'll make the color a little
0:42 bit different. But I also want to show one more thing. I want to show you are ill because remembers the your l that you actually include
0:52 now that didn't automatically make this shared set of data exist. We got to go to our view model and get it passed over.
1:00 So currently we have all pages and let's go put this like so then we need to specify here the top level pages, and here are the shared ones.
1:11 We can use a cool little list comprehension, we say p four p in all pages. If if Pete aunt is shared, if not shared and then we can have our shared be.
1:26 If it is, we could also write database queries. If it's has got a lot of data, maybe it's faster. Makes more sense there. But, you know, honestly,
1:33 I think that's gonna be fine. Let's see how this is working. Come back over here, Refresh it. Oh, yes. Look at that.
1:42 Almost almost what I wanted almost. But let's go and put a little more separation here.
1:49 So it's working. Take away this class that it was making in bold. What I really want is I want a whole separate ordered list.
1:57 So this you Well, it was there. And have you will like this now if you refresh its little gap and may we
2:10 could put a little title or something like that. So over here, let's put a H three CMS pages and this one let's give
2:21 it a shared fared content. Some like that. All right, eyes one indented and the other is not. Ah, because I put it inside. I put it inside the Ah,
2:39 you. Well, there we go. So here's the CMS pages. And then here's the shared content. You can see that is the share that suggested fix that thing.
2:48 We have to write in our import statement in order to use it over right there Pretty cool, huh? So now we've got it.
2:56 Saving the database. We've got our editor able toe edit that. So if I uncheck this and save it, it goes away. Go back and check it.
3:06 It's back down there. Perfect. This pretty much is what we're looking for, isn't it? We have this cool idea of sharing content and we have the ability
3:14 to indicate that some of the content is on Lee shared, and some of it is the top level content of our site.