Opened 19 years ago
Closed 17 years ago
#2461 closed enhancement (fixed)
Add ability to limit depth of tree produced by wp_list_categories()
Reported by: | researcher | Owned by: | pishmishy |
---|---|---|---|
Milestone: | 2.5 | Priority: | normal |
Severity: | normal | Version: | 2.0.1 |
Component: | Template | Keywords: | wp_list_categories has-patch |
Focuses: | Cc: |
Description
the catstructure in WP is well known i think:
Parent1 - Child1A - Child1B Parent2 - Child2A - - Child2A1 - - CHild2A2
and so on.
if Parent2 is chosen with list_cats() you get also all the Children2XX. there is no logic in this from users perspective (if i call Matt, i don't wont to speak to his 12 children! sorry Matt).
my suggestion is; create 3 entities.
first entity = ThisCat (the current category and show all posts) second = ParentCat (should be turned ON or OFF, shows posts in the ParentCat YES or NO) third = ChildCat (should be turned ON or OFF, shows posts in the ChildCat YES or NO)
Attachments (2)
Change History (15)
#2
@
18 years ago
- Resolution invalid deleted
- Status changed from closed to reopened
I'm not sure about the suggested solution, but I share the problem...
Essentially, WP category listing can be very bloated for the end user.
Parent1
- Child1A
- Child1B
Parent2
- Child2A
- - Child2A1
- - CHild2A2
If viewing Parent2, it should be possible to make the ONLY child to be visible should be Child2A (or 2B etc)
I would like options to
1) show all parent categories (relevant if in a subcategory page)
2) show the parents of the current category (in the correct places, see below)
3) Show first children of current category
4) show sibling categories
5) An optional user controllable string could be tagged on if there were undisplayed children categories (default would be [+] )
6) The current category would be displayed with no link on it (allowing for css selection)
So with this structure:
Parent1
- Child1A
- - Child 1A1
- - Child 1A2
- - - Child 1A2A
- Child1B
Parent2
- Child2A
- - Child2A1
- - - Child2A1A
- - CHild2A2
- - - Child2A2A
Parent3
- Child3A
- - Child3A1
- - CHild3A2
Suppose we looked at CHild2A2, it should be possible to display:
Parent1[+]
Parent2
- Child2A
- - Child2A1[+]
- - CHild2A2
- - - Child2A2A <--- no link for this cat
Parent3[+]
Much neater.... and easier to navigate.
#5
@
17 years ago
- Summary changed from Categories and Posts, Parents and Children not separated in list_cats() to Add ability to limit depth of tree produced by list_cats()
- Type changed from defect to enhancement
Reading over the ticket I believe this to be a more accurate description.
#6
@
17 years ago
- Summary changed from Add ability to limit depth of tree produced by list_cats() to Add ability to limit depth of tree produced by wp_list_categories()
Oh and list_cats() is depreciated so...
#7
@
17 years ago
- Keywords wp_list_categories has-patch added; list_cats removed
- Owner changed from anonymous to pishmishy
- Status changed from reopened to new
Trivial patch allows depth of tree walk to be set manually by the theme author. Defaults to existing value of 0. Documentation will need updating if it is decided to commit this patch.
Does a similar option need to be included for other tree walks?
Sorry, I don't understand this.