Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
As mentioned here http://our.umbraco.org/forum/umbraco-7/using-umbraco-7/47465-Get-tag-count-in-v7
Is there a way to return the number of times a tag has been used?
The legacy Tag.cs https://github.com/umbraco/Umbraco-CMS/blob/d1c5ddc03dfb79195e1c97eededcabc9dcaa1365/src/umbraco.cms/businesslogic/Tags/Tag.cs#L16 had a property "nodeCount".
I don't believe the new API supports this unfortunately, at least when I looked at this a few months ago I had to use the legacy method, like this:
tags = umbraco.cms.businesslogic.Tags.Tag.GetTags("default")
.OrderByDescending(x => x.NodeCount)
.Select(x => new TagDetail
Text = x.TagCaption,
NumberOfArticles = x.NodeCount,
TagDetail is a custom object in my application.
This is also how I implemented it before however we're experiencing a bug where tags from different categories are appearing in the list even though the category is set in the GetTags function.
I put it down to a bug with Umbraco 7/legacy so needed the nodeCount property on the new API.
I've also now added node count to TagQuery:
Since it already existed on the tag service:
Hi – does anyone have an example of using the TagService in 7.2 to get the Tag cloud given the tag(s) for the current IPC node?
i.e. using the tags of the current content node, give me a list of other content nodes with the same tags, ordered by total matched count.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted