We are looking into auditing our information. How can we easily count pieces of content per type?
We are able to list content type with this: #set($iApiListResponse = $core_v2_contentType.List())
Looking to then count content per content-type-id
We are looking into auditing our information. How can we easily count pieces of content per type?
We are able to list content type with this: #set($iApiListResponse = $core_v2_contentType.List())
Looking to then count content per content-type-id
Are you just looking for a count of all content items? Or do you need additional information around those items?
Within reporting I can view the content section and look at all time (the time your community has been around)
You can see counts of all content types
Hi Stephen, you could try using search to help with this and using the contenttype as a facet as your example shows velocity this snippet might help you
## expose facet on content type #set ($contentTypeFacets = "contenttypeid,count,50,0,1") ## simple query as we are only interested in the facets #set ($contentTypesQuery = "%{}") $contentTypesQuery.Add("Query", "*") $contentTypesQuery.Add("PageSize", 1) $contentTypesQuery.Add("PageIndex", 0) $contentTypesQuery.Add("FieldFacets", $contentTypeFacets) #set ($searchResults = $core_v2_searchResult.List($contentTypesQuery)) #foreach ($facet in $searchResults.FieldFacets) ## do somsmthing with the values $facet.Fieldname $facet.FieldValue $facet.DocumentCount #end
A crude way to do this is to make this type of call for each content type in question:
#set($type = $core_v2_forumThread.List())
$type.TotalCount Threads
#set($type = $core_v2_blogPost.List())
$type.TotalCount Blog Posts