Freedom

Terms

·   1 min ·   Gautham Chettiar

For a given taxonomy, renders a list of terms assigned to the page or site.

Location : layouts/_partials/widgets/terms.html

Parameters :

ParameterTypeDescriptionDefault
taxonomystringThe taxonomy name (e.g., "tags", "categories")required
pagePagePage context (for page terms)-
siteSiteSite context (for all terms)-
taxonomyFromstringSource: "page" or "site""page"
classstringAdditional CSS classes-
keystringConfig key for visibilitytaxonomy name

Configuration :

yaml
params:
  showTags: true       # Show/hide tags
  showTagsCount: true  # Show/hide tag count
  showCategories: true # Show/hide categories
  showCategoriesCount: true # Show/hide category count

Examples :

go
// Page tags
{{ partial "widgets/terms.html" (dict "taxonomy" "tags" "page" .) }}

// All site tags
{{ partial "widgets/terms.html" (dict 
  "taxonomy" "tags" 
  "site" .Site 
  "taxonomyFrom" "site"
) }}

// Categories with custom class
{{ partial "widgets/terms.html" (dict 
  "taxonomy" "categories" 
  "page" . 
  "class" "post-cats"
) }}

// Without count
{{ partial "widgets/terms.html" (dict 
  "taxonomy" "tags" 
  "page" .
  "key" "tags"
) }}