Ticket #4518 (closed Bug: fixed)
navtree ignores topLevel setting
| Reported by: | mdawson | Owned by: | |
|---|---|---|---|
| Priority: | major | Milestone: | 2.1.3 |
| Component: | Navigation/Folder listings | Keywords: | |
| Cc: |
Description (last modified by hannosch) (diff)
the navigation tree shows all the objects from the root downwards, even though topLevel is set to '3'. This problem arose after a 2.0.5 -> 2.1rc2 migration.
There seems to be a new 'showAllParents' setting which is enabled by default, but changing this has no effect.
Attachments
Change History
comment:2 Changed 6 years ago by jensens
please remove/hide/disable unsupported settings. its pure confusion to 1000 poor plone users out there in the world.
comment:3 Changed 6 years ago by limi
Uhm, it *is* hidden - it's a ZMI string field, not exposed in the preference panels.
Changed 6 years ago by jensens
-
attachment
Plone-topLevel-patch.4.diff
added
Plone-topLevel-patch.diff
comment:4 Changed 6 years ago by jensens
I wrote some lines to support topLevel. But somebody of the navtree-authors should review it. I might have overrule some 'hidden magic'(tm). Patch is attached.
Changed 6 years ago by jensens
-
attachment
Plone-topLevel-patch-v2.4.diff
added
Plone-topLevel-patch-v2.diff
comment:5 Changed 6 years ago by jensens
did some refinement and has support of includeTop now. may need more refinement in its support, I'am a newbie in new style Navtree and dont have all use-cases in mind :o)
problems with this patch:
- sitemap
- includeTop: all siblings of the current topLevel are shown, imo they shouldnt be shown.
the bigger and core problem while working with the new navtree:
-> theres no documentation how it currently work/ how it has to work.
Changed 6 years ago by jensens
-
attachment
Plone-topLevel-patch-v3.4.diff
added
Plone-topLevel-patch-v3.diff
comment:6 Changed 6 years ago by jensens
phew, folks, one more day navtree and my brain gets knots in ...
finally v3 of the patch. it works fine and supports showallParents together with includeTop on topLevel setting.
this is now much deeper than the thin layer behind i did in the previous patches, but imo its much cleaner now.
looking forward to your comments.
Jensens
comment:7 Changed 6 years ago by hannosch
- Description modified (diff)
- Milestone changed from 2.1.x to 2.1.3
comment:8 Changed 6 years ago by ctxlken
This patch v4 works great for getting the nav to allow for starting at a 2nd or lower level, but if you want to have the default behavior of topLevel = 0, it seems to not allow for that.
If I set a site to topLevel = 0, it gets no navigation links at any level of the site (except for the 'Home' link due to the fact that I have includeTop enabled.)
So, we need another patch that allows you to 'have it both ways' - to set topLevel = 0 and work as the default Plone nav works, or to have a topLevel > 0 which works as it does with the v4 patch.
comment:9 Changed 6 years ago by ctxlken
I just wrapped every line of the v4 patch after the first line (topLevel = ntp.getProperty('topLevel',0) ) with the condition below and now everything works perfectly (i.e. the way it did in Plone 2.0.5).
if topLevel != 0:
<do the v4 patch stuff>
comment:10 Changed 6 years ago by ctxlken
I was mistaken - my last fix does not make the left nav work completely as expected (as it did with Plone 2.0.5) - it still fails to include the top-most element.
Say you have About-->Partner Profiles-->Joe Smith
Well, even with all of the above fixes, you won't see the 'About' level in the left nav. Instead, the top element will appear to be 'Partner Profiles', with Joe Smith nested below.
I hope this gets fixed for Plone 2.1.3, but judging by the level of activity on it, I have my doubts.
comment:11 Changed 6 years ago by ctxlken
Sorry- I take it back - my final fix does work. The 'About' link in the above example was not showing, because I had topLevel = 1, so it was acting as would be expected.
comment:12 Changed 6 years ago by hannosch
- Status changed from new to closed
- Resolution set to fixed
- Milestone changed from 2.1.x to 2.1.3
This is fixed in SVN, thx to optilude ;)

There's no support for that setting in 2.1, we'll see if we can add it in 2.1.x.