-
-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Menus API #278
Comments
Hi @jasonHav! As it happens, I've had this in mind for a while :) I've already started laying some of the groundwork for it in this release (e.g. #276, and #279). I got pretty far in a local branch, but the changes were a little too 'sweeping', so I've decided to take a more incremental approach, improving other things as I go. |
Looking good! I'll find a project to have a play with it and get you any feedback I can. |
Great, thanks @jasonHav. If you need any help getting things to work, let me know.
The short answer there is that there's basically very little code in |
@ababic I actually want to write a Vue based application and this kind of API would be great. (At least to have a serializer which I can use on my own API endpoint) |
Thank you for the update. In the meanwhile I will just write my own serializer :) |
I am trying to iterate over the main menu. I tried to read your code but it is not easy for a beginner :D EDIT: With that method I get the first level. How can I get the next level of an menu item? |
@sowinski. Menu items aren't really designed to be recursively queried in this way, I'm afraid. Menu instances usually prefetch all of the page data they need in advance of rendering, and sub menus request their page data from the original menu instance. This pattern works well for rendering menus from template tags, but it's tricky to make use of it directly like this. I'm afraid all I can do is recommend that you take a look at the views and serializers from #302, and see if you can work things out from there. |
@ababic If you need help (testing, feedback, examples etc.) let me know. |
Any news on the API progress? Just starting on a project with VUE and wagtail and this would be great to use along. |
@onno-timmerman I've simply not had the time to look any closer at it for a few months. Where the PR is right now is: It works, but I haven't really figured out what I want to do in terms of caching/cachability, which I feel is important element. It's easy to add template fragment caching when using the template tag approach, but you kinda lose that option when you take the modern js / API route... unless the API has something built in. |
Using this I'm getting an error
|
Any updates on this feature? |
how did you get around this situation? did you use normal wagtail pages to structure the menus? |
Has this feature been merged? |
@viirak no, still a work in progress |
Hi everyone! Is it still a WIP? |
Abandoned now, sorry. |
Hey folks, so I'm going ahead and closing the issue. I feel it's stale now. Feel free to open a new issue if you still require this feature. |
Hey guys,
Is there any consideration to adding an API endpoint to retrieve menus? Combined with the Wagtail v2 API, I can see a great toolset to make React/Angular/Vue driven Wagtail sites.
The text was updated successfully, but these errors were encountered: