How to Add Routable Pages to your Wagtail CMS Website

  Рет қаралды 12,495

Coding For Everybody

Coding For Everybody

Күн бұрын

Routable Pages allow us to create "subpages" under any regular Wagtail Page. Essentially, we can create pages with urls that aren't accessible through the Wagtail CMS admin. We'll learn how to implement routable pages, how to add additional context to the new page, how to render a new page template, how to reverse the routable page url in the template and how to reverse the routable page url in the Wagtail model.
Tutorial: learnwagtail.com/tutorials/ro...
The Git Commit: github.com/CodingForEverybody...
Part 2 of this video can be found here • Wagtail CMS: Routable ...
Learn Wagtail from scratch with the official Wagtail for Beginners Course
learnwagtail.com/wagtail-for-...
Used in this video: Wagtail 2.4, Python 3.7, Django 2.1.5 #Wagtail #Django #Python

Пікірлер: 21
@unperrier5998
@unperrier5998 4 жыл бұрын
About the trailing slash, it works because django has a middleware that will redirect to the url ending with a slash. But there are a config option in wagtail to not use the trailing slash and in this case it won't use django's middleware that tries with a trailing slash. Django also has its own settings to do the same thing (but with django's urls)
@salmanaljabri4245
@salmanaljabri4245 5 жыл бұрын
Thanks for the nice tutorial. there are no many wagtail tutorial out there. this really helps. Keep it up :)
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
I'm happy to hear this is helping you! :D
@dsparr1010
@dsparr1010 3 жыл бұрын
*IF YOU'RE WONDERING WHY YOU'RE GETTING A 404 OR CONTEXT ISN'T OVERRIDING : * the class HomePage must extend from RouteablePageMixin FIRST and extend from Page SECOND. I typed : "class HomePage(Page, RoutablePageMixin)" and nothing was working as expected but I wasn't getting an error either. So there ya go! The correct way is "class HomePage(RoutablePageMixin, Page)".
@joncaldbeck5895
@joncaldbeck5895 3 жыл бұрын
Hi. I'm loving the Learn Wagtail course and this tutorial but when I use [:2] to limit the posts to the latest posts routable page, it shows me the first 2 posts rather than the latest 2?
@vijayl2906
@vijayl2906 3 жыл бұрын
after adding some additional pages as root page, how to add those to menus?
@huzaifazahoor654
@huzaifazahoor654 3 жыл бұрын
Hi. How can i add blog lists in Home Page. Kindly share me the link if you have toturial for this.
@addohm
@addohm 4 жыл бұрын
Where is part 2?
@ucsd007
@ucsd007 4 жыл бұрын
Hi Kalob, I'm putting together a website with Wagtail and I'm wondering if it's acceptable to use bits of code from this tutorial. Is it open source or should I be building from scratch? Thank you!
@CodingForEverybody
@CodingForEverybody 4 жыл бұрын
Feel free to steal any of my code here. It's all available on GitHub - the link should be in the description of most videos.
@onnot701
@onnot701 2 жыл бұрын
how to routeblepage with API headless?
@coldfir1784
@coldfir1784 5 жыл бұрын
So let's say that your page displayed a list of categories. Would it be appropriate for your routable page to do a database query on that category and display all matches? Could you make the final url /{{ category }} in a single routable or would you need to do a different routable for each category with the corresponding category name? I'm mainly just trying to understand if I should use routables in this fashion or not.
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
Nope, you can write a @route with regex. The docs have an example here: docs.wagtail.io/en/v2.5.1/reference/contrib/routablepage.html#the-basics
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
Hey @coldfir1784 I just released a new video on exactly how to do this. kzbin.info/www/bejne/nZDGpKyeq7yleMk
@n8thanael
@n8thanael 2 жыл бұрын
Thanks! Was looking for how to do this ... I couldn't find this in the Wagtail documentation
@helderandrade1476
@helderandrade1476 5 жыл бұрын
helloo, how can i add other static url pages? i dont know if im doing the right way..
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
You'll want to add a line like this above the wagtail page include in your urls.py url(r'^custom-url/$', TemplateView.as_view(template_name='templates/custom-page.html')),
@helderandrade1476
@helderandrade1476 5 жыл бұрын
@@CodingForEverybody thnx for the answer! i did it but is guiving me a 404 error, iam trying to add a static page to a nav bar ^_^'
@SaintTheDreamer
@SaintTheDreamer 4 жыл бұрын
Great videos, keep it up. On the flip side - it would help to keep focus on the topic and reduce small talk as it becomes confusing when you say something and then contradict yourself !
Wagtail CMS: How to Create a Custom Wagtail Menu System
38:22
Coding For Everybody
Рет қаралды 20 М.
Headless Wagtail CMS: How to Enable the v2 API to Create a Headless CMS
18:06
Coding For Everybody
Рет қаралды 10 М.
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 35 МЛН
Мы никогда не были так напуганы!
00:15
Аришнев
Рет қаралды 6 МЛН
Adding User Registration/Login To Your Wagtail Website
23:03
Coding For Everybody
Рет қаралды 15 М.
Wagtail CMS: How to extend the Draftail RichText (WYSIWYG) Editor
26:41
Coding For Everybody
Рет қаралды 8 М.
Wagtail CMS: Routable Page Categories And Years
19:01
Coding For Everybody
Рет қаралды 3,8 М.
How to use Orderables in Wagtail CMS
22:42
Coding For Everybody
Рет қаралды 14 М.
Wagtail Sitemaps: Adding, Modifying and Removing Sitemap Entries
11:25
Coding For Everybody
Рет қаралды 6 М.
Installing Django Debug Toolbar with Wagtail CMS
13:33
Coding For Everybody
Рет қаралды 17 М.
Wagtail CMS: Adding custom CSS and JavaScript to Your Admin area
20:04
Coding For Everybody
Рет қаралды 9 М.
How to Add a Basic StreamField to your Wagtail CMS Page
19:34
Coding For Everybody
Рет қаралды 26 М.
HOW DID HE WIN? 😱
00:33
Topper Guild
Рет қаралды 35 МЛН