-
Notifications
You must be signed in to change notification settings - Fork 130
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
Some improvemens #161
base: master
Are you sure you want to change the base?
Some improvemens #161
Conversation
2. items visibility by menu name 3. `as` for sitetree_children tag
|
Hi, Yeah, that's quite a bunch of changes %) Sounds interesting. Thank you! |
I'm almost positive about |
|
Soft menu for root for django native migrations
Django native migration fix
|
sitetree_breadcrumbs добавлено ключевое слово"as"
Hi!
I've made some changes, that could be useful maybe.
as
for sitetree_menu and sitetree_children templatetags.Can be useful, when we have fixed depth menu with different styles for levels.
i18n_patterns improvements.
Possibly, fix for #123 .
I have a part on my site, which is translated into 5 languages,
using i18n_patterns for handling requests. All content, menu structure etc
are absolutely the same. That's why I don't want to use 'built-in' internationalization system — I don't want 5 identical menus, so I use django-modeltranslation.
I've made a menu, something like that:
But when the real request.path was '/ru/eu/about/' current_item was None.
Other issue is that {% sitetree_url %} returned url without current language prefix.
I fixed both, and I think my proposal keeps backwards compatibility.
softroots
We already discussed it here #145 .
I call it 'softroots' now, like in django-cms menu (http://docs.django-cms.org/en/2.4.2/getting_started/navigation.html#soft-roots).
Softroot is an item acting like root when climbing up the tree.
The difference with django-cms way is that my proposal is to make softroots 'named'. So one item could by softroot for topmenu, other for leftmenu, and another for both.
For example:
For example, we can make "B" a softroot for 'topmenu', and "B1" would be softroot for 'leftmenu'. Let current item be "B1A".
{% sitetree_menu from "ourtree" include "this-softroot" name "topmenu" %} will climb up to "B" and use "B" as parent.
{% sitetree_menu from "ourtree" include "this-softroot" name "leftmenu" %} will climb up to "B1" and use "B1" as parent.
I've added
name
arg for sitetree_menu and sitetree_children, it is rendered menu name.I've added
softroot_for
field to TreeItem model, it is a comma separated list of menu names, for which this item acts like softroot.hide_from
Since we have a concept of menu names, we can toggle item visibility according to menu name, not only for the whole menu.
I've added
hide_from
field to TreeItem model, it is a comma separated list of menu names, for which this item is hidden.with_parents
When current item is "A", "A1" or "A2" I need my left menu to be [A, A1, A2] i.e. I want parent to be the first menu element.
I've added
include_parent
arg for sitetree_menu, when it's set, parents will be included to menu items.Usage: {% sitetree_menu from "ourtree" include "this-softroot" name "topmenu" include_parent %}
Has this pull request a chance to be merged? Maybe some parts :)