Wagtail CMS: How to Create a Custom Wagtail Menu System

  Рет қаралды 19,992

Coding For Everybody

Coding For Everybody

Күн бұрын

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, Oderable, Snippet, and a custom template tag.. from scratch!
We'll also learn how to:
* Create a custom template tag, and loop through all the menu items
* Create custom properties in our MenuItem class to perform logic for us, so our templates can stay clean
* And more...
Full Tutorial: learnwagtail.com/tutorials/ho...
Git Commit: github.com/CodingForEverybody...
Wagtail Menus Package: github.com/rkhleics/wagtailmenus #Wagtail #Django #Python

Пікірлер: 36
@theflyingcrab2827
@theflyingcrab2827 4 жыл бұрын
You, sir, are awesome! I was never a fond of video tutorials before I watched yours. These are not fast, not slow, not loud, not feeble, not boring, not comic... everything is just perfect. Thanks much for all the efforts you are putting into these.
@AyazAmlani
@AyazAmlani 5 жыл бұрын
i loved this lesson. I have been using djangos templating language and didnt know i could create templatetags so easily like that.
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
Oh yeah, nice and easy!!
@mahmoudabdelmoneim786
@mahmoudabdelmoneim786 5 жыл бұрын
Awesome tutorials, you have a super great way to keep things simple. please keep it up, waiting for more. :)
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
Thanks for the kind words! Glad you're enjoying this series!
@van3787
@van3787 3 жыл бұрын
I"m learning so much from this playlist, but this video especially, was very helpful Thank you Kalob
@aaronbrown5558
@aaronbrown5558 3 жыл бұрын
These are great videos. I've learned a TON.
@sharifahmed1925
@sharifahmed1925 3 жыл бұрын
Hi Kalob :) Hope you're well If I'm planning to use Django purely as an API and have React.js or Next.js handle all the Frontend, are there any benefits of using Wagtail instead of Django? Love to hear your thoughts
@AlekseyFilippovHuzzah
@AlekseyFilippovHuzzah 2 жыл бұрын
Maybe you have kind of advice for a complex menu design. Wagtailmenus is beyond consideration since they do not support api endpoints. By complex I mostly mean several layers of nesting. Should I compose the structure from the separate linear menus as you suggest at the end of the video?
@tanveerahmed1040
@tanveerahmed1040 5 жыл бұрын
Thank You Please Keep it up Make more videos.
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
I have a few more planned for next week already! :D
@asgeralia8802
@asgeralia8802 Жыл бұрын
Superb superb superb
@actionaticsdev8144
@actionaticsdev8144 5 жыл бұрын
I have the following problem with AutoSlugField, It converts my "title" and adds the convenient "-" and lower caps it, however it does not show it in real time as I type the title. Can anybody help me? Thanks
@BenLamptey
@BenLamptey Жыл бұрын
i think i might be having a caching issue here. I can't get the menu items to display even though i've copied it word for word. However i do notice the menu items do appear in my template when i comment out "{% extends base_template %}" which is the first line in my template - however i need this extension as it contains header, footer etc
@hadiboukdir386
@hadiboukdir386 5 жыл бұрын
Hi, First of all thank you very much for this tutorial. Just wondering is there a way to make the selected page in the menu 'Active' ? same as you did at the pagination! Thank you again
@hadiboukdir386
@hadiboukdir386 5 жыл бұрын
Just want to let you know that I figured out how to fix it. {{ item.title }}
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
@@hadiboukdir386 Exactly what I was going to suggest. Great job, and thanks for sharing the answer here!
@tanveerahmed1040
@tanveerahmed1040 Жыл бұрын
How can We add Blog Category in menus and render those categories in template currently using snippets for categories then how categories should be create and add in menus, LIKE WE DO in Wordpress.Thank You.
@joaogoncalves4525
@joaogoncalves4525 2 жыл бұрын
hey, is it possible to loop the clisterableModel and then loop the ordarable?
@ryanmorris5709
@ryanmorris5709 5 жыл бұрын
How can one mix in drop-down-links with this menu? Can you have an orderable in an orderable? or maybe use stream-fields in here instead?
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
You could do both, theoretically. An orderable inside an orderable would would But if you need a more complex menu look into wagtailmenus as it'll do what you're looking for out of the box: github.com/rkhleics/wagtailmenus
@magdagaj
@magdagaj 4 жыл бұрын
Hi, yet another great tutorial, however.. If I allow my client to create/rename/delete menus and the name of the menu is hardcoded in the base template ({% get_menu "main" as navigation %}), the whole navigation wont work.
@CodingForEverybody
@CodingForEverybody 4 жыл бұрын
Yep, that's a flaw in this method. You can also change the template tag to look for the first menu, or use an id, etc.
@lakhumeghani239
@lakhumeghani239 4 жыл бұрын
How to created custom object "Snippet" between setting and documents. I want to know how to create custom object like snippet or any other say "News". If related link please share. Thanks in advance
@magdagaj
@magdagaj 4 жыл бұрын
I used ModelAdmin and logic form Subscribers tutorial to add Menus to the admin panel rather than to Snippets. It works for me.
@bckstrtby200
@bckstrtby200 2 жыл бұрын
How to have child_item in the main menu?
@markkos2426
@markkos2426 5 жыл бұрын
I'm getting the error "DoesNotExist at /about/ Menu matching query does not exist." menus_tags.py seems to not inherit Menu properly do you know how I can fix that? I'm at the point where I just copied your code and it still won't work Vscode also gives me this error : "Attempted relative import beyond top-level packagepylint(relative-beyond-top-level)" when I'm trying to import Menu
@CodingForEverybody
@CodingForEverybody 5 жыл бұрын
Do you have all the right packages installed? You can install the packages I'm using with `pip install -r requirements.txt`
@boasorte6808
@boasorte6808 2 жыл бұрын
Seriously, how do you remember and know all the classes, functions, and syntax? How do you know exactly what you need from so much documentation?
@douglasalves1155
@douglasalves1155 4 жыл бұрын
Hello, I have a little beginner problem :- D , could you help me? I got to the 23:42 part of the lesson, but I need the page link to redirect to an internal link on the page itself, for example: Products I filled in "#products" in the link url field, but it didn't work. Thanks a lot!
@CodingForEverybody
@CodingForEverybody 4 жыл бұрын
Hey Douglas, instead of using a link to a Page, you could add a CharField for the internet link (ie #products) and use an if/else to detect if the link is internal or external.
@douglasalves1155
@douglasalves1155 4 жыл бұрын
Humm... Nice :D. It's my first time using CMS and I dont know many things in django, I'm doing everything on the basis of stubbornness, kkkkkk. Thanks
@patricksarmiento4494
@patricksarmiento4494 3 жыл бұрын
does this work for a headless wagtail setup? i assume not?
@CodingForEverybody
@CodingForEverybody 3 жыл бұрын
No you'll need to expose the menu system through your API manually.
@CodingForEverybody
@CodingForEverybody 3 жыл бұрын
Though you can filter by pages that have `show in menu` checked with the default Wagtail pages API
@cheryl_jones
@cheryl_jones 3 жыл бұрын
Thanks for the tutorial - it's really helpful. Though, I could not for the life of me get AutoSlugField to work.
How to Add Routable Pages to your Wagtail CMS Website
24:27
Coding For Everybody
Рет қаралды 12 М.
1❤️
00:17
Nonomen ノノメン
Рет қаралды 12 МЛН
I wish I could change THIS fast! 🤣
00:33
America's Got Talent
Рет қаралды 101 МЛН
THEY made a RAINBOW M&M 🤩😳 LeoNata family #shorts
00:49
LeoNata Family
Рет қаралды 16 МЛН
Дибала против вратаря Легенды
00:33
Mr. Oleynik
Рет қаралды 4,6 МЛН
Headless Wagtail CMS: How to Enable the v2 API to Create a Headless CMS
18:06
Coding For Everybody
Рет қаралды 10 М.
How to Use ListBlocks in Wagtail CMS to Create Repeating StreamField Content
19:52
How to use Orderables in Wagtail CMS
22:42
Coding For Everybody
Рет қаралды 14 М.
Installing Django Debug Toolbar with Wagtail CMS
13:33
Coding For Everybody
Рет қаралды 17 М.
React Crash Course 2024
3:04:36
Traversy Media
Рет қаралды 335 М.
Wagtail CMS: How to extend the Draftail RichText (WYSIWYG) Editor
26:41
Coding For Everybody
Рет қаралды 8 М.
Wagtail CMS: Registering Snippets using Django Models
13:35
Coding For Everybody
Рет қаралды 10 М.
1❤️
00:17
Nonomen ノノメン
Рет қаралды 12 МЛН