How to search among ranged items?

I have this content building system implemented that searches for tags in markdown frontmatter:

{{- if isset .Site.Taxonomies "tag" }}
{{- if not (eq (len .Site.Taxonomies.tag) 0) }}
<ul class="list-unstyled">
  {{- range $name, $items := .Site.Taxonomies.tag }}
  <li class="small">
    <a class="cat-item d-flex justify-content-between text-dark px-1"
      href="{{ `tag/` | relLangURL }}{{ $name | urlize | lower }}">{{ $name | title | humanize }}<span>{{len $items}}</span></a>
  </li>
  {{- end }}
</ul>
{{- end }}
{{- end }}

It finds tags if they are listed like separate items:

---
date:
tag: sports

---

But if tags are listed among ranged items:

---
date:
sportsitems:
  - image: 
    itemname: 
    description: 
    price: 
    tag: Women's bags
  - image: 
    itemname: 
    description: 
    price: 
    tag: Men's shoes

---

it does not find them. How these tags among ranged items can be found?
Thanks!

Could it be that it’s because you have a taxonomy under a different parameter?

Instead of ranging through site.Taxonomies.Tags you need to range through .Page.sportsitems.tag?

Or change where that tag taxonomy is set in your hugo file.

Wow, this indeed may be. I’ll give it a try. Thanks!