Adding a CMS to Your Pyramid Web App Transcripts
Chapter: The Pages
Lecture: Editing CMS pages
Login or
purchase this course
to watch this video and the rest of the course contents.
0:00
Now that we have adding new pages in place. It should be really, really quick to edit new ones. Okay, so over here we have add Page.
0:07
Let's do edit page. Edit, really important that you don't forget to change that right there. It's gonna be the same template stuff there.
0:20
This is gonna be edit page, page. Alright, it's gonna add or edit, and yeah, looks like that might actually do it. Let's give it a shot.
0:30
Come over here. Admin. Wiew the pages. Let's create one that we can test. A test, test. "This is to be tested" All right, fingers crossed. Here we go.
0:45
Ho! Sweet. It's not really that surprising that this works because, you know, we got it working in the request, the redirect one,
0:53
and here's kind of a cool one but nonetheless, this is pretty cool. Now remember, this is, for the moment, pure HTML.
1:07
So every time you want a line break, you got a little HTML bits here, but we can have some fun with it. Thing one Thing two and thing three
1:28
page with this id was not found. I was feeling so good about us. So good about our chances here. Well, let's go back to admin and see what's going on.
1:41
All right? Something is not working here, So let's go and dive in and back real quickly.
1:47
I said get page, but it's just a breakpoint and have a quick look. Now, remember, because we restarted it. It's gonna lose that page.
1:53
I gotta recreate it first, and then we can go to debug. What's up with it? Luckily, I copied that. So we create that and
2:08
this one right here... Change that to a four. Oh, I see. So whatever is happening, this is just not making it that far.
2:18
Let's go up a bit here with that breakpoint and try again. Alright, so something's happening along the way.
2:36
Alright, it's in the view model. Whatever the problem is, it is in the view model. So where do we have that? Yeah, eight one...
2:42
Ah said this string thing again. We're gonna find out. We got the page, and then. There it is. You see it, folks, it's not redirect by page by ID.
2:57
Alright, start over. This is gonna work. Make sure I copy this again. Okay. Go to our admin. View our pages create a new one. We'll call it "Test".
3:15
So we'll start out nice and simple and let's go at it again, and this time put our nice content with HTML. You ready?
3:21
Woo! It looks like it might have worked. And of course it did. There it is. Silly little mistake.
3:26
There's a ton of redirects to changed the page all over the place. And I unfortunately missed that one, but nonetheless do we have it?
3:34
We have got this cool page. We can go over to our admin section and go. You know what? We didn't really want this to have that line break there.
3:40
We just wanted to have, like this and then these. First one is going to be bold. So we can do this </strong>.
3:49
And now if we visit that page Boom, There it is. We have this live website we could just go in and edit stuff. It's beautiful,
3:55
except for when it's not because editing this is really error prone. So we're going to come up with a much better implementation foer our editor.
4:05
But for now, it's working really, really well, isn't it?