Adding a CMS to Your Pyramid Web App Transcripts
Chapter: Advanced Markdown templates
Lecture: Formatted elements

Login or purchase this course to watch this video and the rest of the course contents.
0:00 well, our pages looking pretty good. But there's one thing I want to talk about and that's formatting this content.
0:07 Or, to be honest, any form of content.
0:10 If I want to put an image there and have it spanned the whole page exactly, regardless of the size of the image, the sides of your screen or if I want to have, like, let's say, if we want this gray and smaller tax or something along those lines.
0:22 So let's go make that happen because landing pages or other sort of marketing pages are not super interesting if you don't have a lot of control over.
0:29 So we wanna adjust the CMS pages, sometimes beyond what Mark down really wants us to dio. So let's go to this problem section now.
0:37 It might first seem like, Well, what we can do is we can put this into a A divorce, some HTML container, and then on here.
0:45 We could set a style, and let's say the style is gonna be color is grey font size is 0.7 p. M. That is 70% of the normal size. Now go ahead.
0:57 This and we view our donate or donate has a look. It's gray. That's awesome, like we wanted. But wait a minute. What the heck just happened here?
1:06 If we expect this element, you'll see that. Well, basically, what happened down here is this section not that section.
1:15 This section here it got the styles. You can see the styles and HTML are in here. But then it didn't process the mark down. Right?
1:23 This basically didn't get parts by mark down. But you can see the stuff of here. Did the little header. You see a problem? Pieced it.
1:30 Let's go back and look this again. Here's the deal with this library. You cannot mix HTML. Let me rephrase that.
1:40 You cannot embed mark down within HTML although you can't include it.
1:44 So, for example, this got processed is marked down, converted to an H four just fine. This got pastors HTML just fine. But the stuff in here didn't to.
1:55 You actually can put these little slices of HTML in here like if you want have an image, you can just put the image with some styles and put it in there and that's great and the rest can be marked out.
2:05 But here's the thing is the stuff inside has to be standard HTML. Right.
2:11 So here we gotta put like an h ref equals slash a And then we put the pieces go in there, right? So here's the body.
2:20 Next, here's the euro that goes there. Even throw in a cool target equals like like that to get it to go to a new tab. Let's update this.
2:32 Go back and view our donate. Now watch. This should get fixed and it does super. So here. This is the markdown part of that reuse bit.
2:41 And here's a little HTML fragment we stuck in there. Yeah, it doesn't look super good.
2:45 Like the way it is on the page, but that's not really the point, right? It's just that weaken style this and get it to behave the way that we'd like.
2:51 So here we have a hyperlink that opens in a new tab, Super easy to dio so you can do way more with these CMS pages, regardless of whether their shared like we were working on a shared section habit.
3:04 It's not the fact that it shared its just the way the mark down the underlying marked down to library works does it want pars marked on within HTML fragments, So that's fine.
3:14 You can do this for any page or any parts of the page, and you can put these little HTML elements in here and then you're good to go.
3:22 You have all this content.
3:24 Most of it's written in markdown, but these little pieces you can write in HTML have a little more control over how that small part of the page looks.

Talk Python's Mastodon Michael Kennedy's Mastodon