Use the tree for taxonomy.Pages()

This commit is contained in:
Bjørn Erik Pedersen
2020-02-18 18:49:11 +01:00
parent 36983e6189
commit b2dcd53e3c
3 changed files with 39 additions and 8 deletions

View File

@@ -827,6 +827,20 @@ func (b *pagesMapBucket) getTaxonomies() page.Pages {
return b.sections
}
func (b *pagesMapBucket) getTaxonomyEntries() page.Pages {
var pas page.Pages
ref := b.owner.treeRef
viewInfo := ref.n.viewInfo
prefix := strings.ToLower("/" + viewInfo.name.plural + "/" + viewInfo.termKey + "/")
ref.m.taxonomyEntries.WalkPrefix(prefix, func(s string, v interface{}) bool {
n := v.(*contentNode)
pas = append(pas, n.viewInfo.ref.p)
return false
})
page.SortByDefault(pas)
return pas
}
type sectionAggregate struct {
datesAll resource.Dates
datesSection resource.Dates