Tutorial Wagtail Version: 2.x
Almost every website has some form of navigation. Wagtail websites are no different. But creating a menu isn't as easy as making top level pages (although that's an option!). In this tutorial we're going to explore how to create a Menu System using a Clusterable Model, an Oderable, a Snippet, and a custom template tag.. from scratch!
Every good site has a navigation, and it's usually found in the header.
Wagtail already comes with an option to show pages in your menus, and all you have to do is query pages using PageName.objects.live().in_menu()
.
But that doesn't give you control over the placement of each page. So let's say you wanted a contact button to the very right of your menu, that's gets harder to do. You can drag and drop pages to have the proper order, and that would solve the ordering problem.
But what if you want to link to:
Well then you're kind of stuck if you want either of those options. Also creating a mega menu would be pretty difficult.
Luckily Wagtail gives us all the ingredients we need to make our own custom menu system using:
Below you'll find the code that was used in the video.
Note: there are different files, and they all belong to an app called "menus".
Near the end of this video I briefly talk about a package called wagtailmenus that basically does all of this for you (and a little more). Here are the link:
How to Enable the v2 API to Create a Headless CMS
Posted on
Wagtail comes with a lot of really powerful features. Many features are not enabled by default as to keep your site running quickly and efficiently. One of those amazing features is the Wagtail v2 API, which can return any page, image, document, orderable and StreamField as a JSON response for your SPA/PWA to consume. We'll enable this by adding just 12 lines of code to our Wagtail CMS website.
How to Use ListBlocks to Create Repeating StreamField Content
Posted on
Occasionally you'll want a StreamField that can have multiple repeating content areas. A good example is the design component known as a Card. In this lesson we'll explore a ListBlock to enable us to create unlimited cards with custom data, ImageChooserBlock, PageChooserBlock and how to loop through a ListBlock in your Wagtail CMS template.
15. A Customizable Multilingual Navigation Menu
Posted on
How to Deploy Wagtail to Heroku
Posted on
Learn how to deploy a brand new Wagtail site to a free Heroku instance.
This course covers everything from basic installation to advanced features like custom blocks and API integration, it's perfect for developers looking to enhance their skills with this powerful CMS.