Taglister Count number is wrong?

hi all,

So I’m using Tagllister in my sidebar to show all the tags used in a small blog.
It works, but the count is wrong. It’s actually showing that there are two additional resources with the chosen tag than thre actually is!
So, I have an article which is tagged as ‘tag1’ and no other article has this tag - yet the count beside the listing says 3.

There are no deleted resources, I have cleared the cache. checked on another browser (not logged in).

This is my call:

 [[!tagLister?
        &tv=`blogTags`
        &parents=`192`
        &target=`194`
        &tpl=`tagLinkTpl`
        &activeCls=`current`
        &cls=``
        &altCls=``
        &weightCls=``
    ]]

And this is my TPL:

<li class="[[+cls]]">
  <a href="[[~[[+target]]? &key=`[[+tagKey]]` &tag=`[[+tag:lcase]]`]]">[[+tag]] <span>[[+count]]</span></a>
</li>

So confused. Any ideas??

Thanks
Andy

Right - I’ve found the reason for this -b ut it makes no sense!
I had the ‘tags’ and ‘archive’ resources within my blog container.
For some reason, it counted those as tags against the count - but neither even have the tag TV enabled on their templates.

The way I found the reason was because my ‘archvist’ count was also wrong - by two resources!!

I moved the ‘tags’ and ‘archive’ resources outside of the blog container, and the count for archives was corrected, along with the count for tags.

Logically, the resources ‘tags’ and ‘archive’ should be within the blog container, is there a way for taglister and archivist to ignore those resources?

I tried hiding form menuss, but it makes no difference.

Thanks!
Andy

Is there is an entry in the database table modx_site_tmplvar_contentvalues for these resources and the corresponding TV-id?


There is a &where property for this snippet. Maybe you can use that:

//restrict to resources with the template-id = 3
[[!tagLister?
        ...
        &where=`{"Resource.template:=": 3}`
]]

Qh nice one harry - yes there were entries of the tags int he database - maybe I duped a previous resource and then changed the template so it retained the TV values. nice one.

I tried your ‘where’ startement on archivist, but it didn’ work (I think this was just for taglister) but I changed it to his which seems to work:

&where=`{"template:=": 35}`

nice one - thanks for your help as always!!

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.