How to use Wagtail Live Preview
Transcript
From Wagtail CMS 2024. Published January 18, 2024.
Watch the video Markdown version 580 words · auto-generated · en
Summary
Wagtail’s Live Preview lets editors see a page as they build it without leaving the editor. The preview panel can show desktop, mobile, and tablet layouts, or open a full-page preview in a new browser tab, and it can be resized to suit the available screen space. Changes to text and block order appear immediately in the preview, making it easier to spot layout and content problems. Required fields must remain populated: removing one produces a warning and prevents the preview from working correctly.
Transcript
Automatically transcribed, so expect mistakes in names and technical terms. Filler words are removed.
0:00 Live Preview Overview
Hi folks, Megan here. I'm going to show you a quick demo today of the Wagtail Live Preview feature So right here we have a page from Wagtail. org. This is our sustainability page. I've already filled out the contents so that I don't bore you with typing. And so it looks pretty good But I don't know what it's going to look like on the page until I open the preview panel. To do that, I'm gonna go up here and click this little phone icon here. And that opens up our preview panel. And right away I can see what the page looks like on a desktop display. But if I wanted to change it up and see how it looks like on different sized devices, I can click this icon here to see the mobile. display and then I could click this icon here to get the tablet display and see how everything looks like with that
0:51 Device Views and Panel Resizing
And I can go back to desktop or if I wanted to see how it looked like on a full page on my browser in a tab, I can open up a whole full page preview in a brand new tab as well, which is super handy. Now one other thing people don't know about the live preview panel is that if, you know, if this text is a little too small to read or you want to you know, adjust it for like your screen size or something like that. You can actually resize the preview panel right here. And so I generally like to pull it all the way out to here just at the edge of the blocks so that I don't cover things up. You may be different. You may want to like take up the whole page or something like that. Anyway, And that way, like if you have a large screen like I do, what you can do is you can leave the preview panel open
1:42 Live Content Updates
and if you're making changes, so like say I wanted to take change this here to Wagtail Goes Green or something like that. You can see that the preview updates with the text as I'm adding it in. This is also useful for like if I'm scrolling through and checking things. Oh look, it looks like these two blocks are out of order. So I'm gonna go down here and I'm going to fix that and make sure that we have them in the correct order. So this one needs to be below that one. So I'm gonna fix that. And now you see the blocks have switched up and the order looks better than that before. Now one thing I want to make sure that you know about our preview panel is that you have to be careful around the
2:32 Required Content Elements
items that have the little red extracts next to them because those are mandatory and our preview works best when the mandatory elements are there. So say I removed this item here, you'll notice like see there's a little warning sign here that tells you that it can't function with without that. So I'm going to go ahead and put that back there That warning goes away and then I can go back to building my content. Anyway, I hope you enjoyed that quick demo and I hope you learned something about our preview panel that you can use for your content today