hugo/content/en/methods/taxonomy/_common/ordered-taxonomy-element-methods.md
Bjørn Erik Pedersen 9b0050e9aa Squashed 'docs/' content from commit 5c085a37b
git-subtree-dir: docs
git-subtree-split: 5c085a37b297bf12f59efeaae591418ec025c10d
2024-01-27 10:48:33 +01:00

989 B

An ordered taxonomy is a slice, where each element is an object that contains the term and a slice of its weighted pages.

Each element of the slice provides these methods:

Count
(int) Returns the number of pages to which the term is assigned.
Page
(page.Page) Returns the term's Page object, useful for linking to the term page.
Pages
(page.Pages) Returns a Pages object containing the Page objects to which the term is assigned, sorted by taxonomic weight. To sort or group, use any of the methods available to the Pages object. For example, sort by the last modification date.
Term
(string) Returns the term name.
WeightedPages
(page.WeightedPages) Returns a slice of weighted pages to which the term is assigned, sorted by taxonomic weight. The Pages method above is more flexible, allowing you to sort and group.