tag cloud widget not filtering properly

 Trying to configure the Tag Cloud widget in our community. We want to show specific tags, but not all tags. In this example, we want to filter to show 3 tags: adobe, ci bulletin, cloudcraze but when those 3 tags are applied, no content appears even though we have content with those tags. 

I haven't been able to fully understand how the filtering is supposed to work from the documentation. It seems like it should show content with any of the outlined tags, but is it actually filtering by content with all 3 tags? If so, that is a poor design.

Please clarify.

  • Hi

    Did you ever receive an answer to this? I am having the same issue, I want to create a tag cloud on a group of tags and no content appears. Any advice?

    Thanks!

  • Hi . If you're using the Tagged Content List widget, how is it configured? There is a configuration option to filter to any or all tags. Checking "Match ANY of these tags" will logically or the results, whereas not checking it will and them. 

  • Hi 

    I am trying to display a tag cloud and do not have that option.

    When I add more than one tag in the Comma separated list field the Tag cloud does not display any content. It seems to only recognize one tag, no more.

  • Understood. Yes, for some reason, the Tag Cloud widget does not currently expose the same OR option that the Tagged Content List widget does, even though the platform supports this. I've logged this as an issue.

    TE-14765

    I've also attached a workaround customized version of the Tag Cloud widget that exposes this option.

    TagCloud-Widget.xml
    <scriptedContentFragments>
    	<scriptedContentFragment name="${resource:Core_TagCloud_Name}" version="10.3.1.7330" description="${resource:Core_TagCloud_Description}" instanceIdentifier="8c838436a4184f83a6f70318e8cc031a" theme="" isCacheable="true" varyCacheByUser="true" showHeaderByDefault="true" cssClass="tag-cloud" lastModified="2019-08-05 21:34:33Z">
    		<contentScript><![CDATA[#set ($applicationType = $core_v2_widget.GetStringValue('applicationType', 'Unknown'))
    #set ($filterTags = $core_v2_widget.GetStringValue('filterTags',''))
    #set ($ignoreFilterTags = $core_v2_widget.GetBoolValue('ignoreFilterTags', false))
    #set ($logicallyOrTags = $core_v2_widget.GetBoolValue('logicallyOrTags',true))
    #set ($maximumTags = $core_v2_widget.GetIntValue('maximumTags', 25))
    #set ($minimumPostsPerTag = $core_v2_widget.GetIntValue('minimumPostsPerTag', 1))
    #set ($showTagCounts = $core_v2_widget.GetBoolValue('showTagCounts',false))
    #set ($enableNoTagsMessage = $core_v2_widget.GetBoolValue('enableNoTagsMessage',false))
    #set ($noTagsText = $core_v2_widget.GetStringValue('noTagsText','${resource:TagCloud_NoTagsDefined}'))
    #set ($linkTo = $core_v2_widget.GetStringValue('linkTo','ContextualTagBrowser'))
    #set ($cssClasses = $core_v2_utility.MakeList('level-6','level-5','level-4','level-3','level-2','level-1'))
    #set ($currentTags = $core_v2_tags.Current)
    
    ## build base tag query
    #set ($query = "%{PageSize=100,PageIndex=0,SortBy='ContentCount',SortOrder='Descending'}")
    #set ($linkQuery = "%{}")
    #set ($showBreadCrumbs = false)
    #if (!$ignoreFilterTags)
    	#if($filterTags.Length == 0 && $currentTags && $currentTags.Count > 0)
    		#set ($filterTags = $core_v2_utility.Join(',',$currentTags))
    		#set($showBreadCrumbs = true)	
    	#end
    	#if ($filterTags && $filterTags.Length > 0)
    		$query.Add('Tags', $filterTags)
    		$query.Add('LogicallyOrTags',$logicallyOrTags)
    	#end
    #end
    
    #if ($core_v2_container.Current)
    	##if widget is on the site home page (on the root group page) then retrieve all tags
    	#if ($core_v2_container.Current.ContainerId != $core_v2_group.Root.ContainerId)
    		$query.Add('ContainerIds', $core_v2_container.Current.ContainerId)
    	#end
    	$linkQuery.Add('ContainerId', $core_v2_container.Current.ContainerId)
    	$linkQuery.Add('ContainerTypeId', $core_v2_container.Current.ContainerTypeId)
    #end
    
    ## load tags
    #set ($tags = false)
    #set ($urlGenerator = false)
    #if ($applicationType == "Forum")
    	#set ($currentForum = $core_v2_forum.Current)
    	$query.Add('ApplicationTypeIds', $core_v2_forum.ApplicationTypeId)
    	$linkQuery.Add('ApplicationTypeId', $core_v2_forum.ApplicationTypeId)
    	#if ($currentForum)
    		$query.Add('ApplicationIds', $currentForum.ApplicationId)
    		$linkQuery.Add('ApplicationId', $currentForum.ApplicationId)
    	#end
    #elseif ($applicationType == "Weblog")
    	#set ($currentBlog = $core_v2_blog.Current)
    	$query.Add('ApplicationTypeIds', $core_v2_blog.ApplicationTypeId)
    	$linkQuery.Add('ApplicationTypeId', $core_v2_blog.ApplicationTypeId)
    	#if ($currentBlog)
    		$query.Add('ApplicationIds', $currentBlog.ApplicationId)
    		$linkQuery.Add('ApplicationId', $currentBlog.ApplicationId)
    	#end
    #elseif ($applicationType == "MediaGallery")
    	#set ($currentGallery = $core_v2_gallery.Current)
    	$query.Add('ApplicationTypeIds', $core_v2_gallery.ApplicationTypeId)
    	$linkQuery.Add('ApplicationTypeId', $core_v2_gallery.ApplicationTypeId)
    	#if ($currentGallery)
    		$query.Add('ApplicationIds', $currentGallery.ApplicationId)
    		$linkQuery.Add('ApplicationId', $currentGallery.ApplicationId)
    	#end
    #elseif ($applicationType == "Wiki")
    	#set ($currentWiki = $core_v2_wiki.Current)
    	$query.Add('ApplicationTypeIds', $core_v2_wiki.ApplicationTypeId)
    	$linkQuery.Add('ApplicationTypeId', $core_v2_wiki.ApplicationTypeId)
    	#if ($currentWiki)
    		$query.Add('ApplicationIds', $currentWiki.ApplicationId)
    		$linkQuery.Add('ApplicationId', $currentWiki.ApplicationId)
    	#end
    #elseif ($applicationType == "Unknown")
    	#if($core_v2_application.Current)
    		$query.Add('ApplicationIds', $core_v2_application.Current.ApplicationId)
    		$linkQuery.Add('ApplicationId', $core_v2_application.Current.ApplicationId)
    	#end
    	#if ($core_v2_applicationType.Current)
    		$query.Add('ApplicationTypeIds', $core_v2_applicationType.Current.Id)
    		$linkQuery.Add('ApplicationTypeId', $core_v2_applicationType.Current.Id)
    	#end
    #end
    
    #if ($showBreadCrumbs)
    	#if($core_v2_tags.Current && $core_v2_tags.Current.Count > 0)
    		<ul class="breadcrumbs">
    			$linkQuery.Remove('Tags')
    			#set($tagUrl = false)
    			#set($tagUrl = $core_v2_urls.Tags($linkQuery))
    			#if ($tagUrl)
    				<li class="breadcrumb"><a href="$core_v2_encoding.HtmlAttributeEncode($tagUrl)">$core_v2_language.GetResource('AllTags')</a></li>
    			#end
    	
    			#set($index = 0)
    			#foreach($tag in $core_v2_tags.Current)
    			#each
    				#set($index = $index + 1)
    				$linkQuery.Remove('Tags')
    				$linkQuery.Add('Tags', $core_v2_utility.Join(',', $core_v2_utility.Slice($core_v2_tags.Current, 0, $index)))				
    				#set($tagUrl = false)
    				#set($tagUrl = $core_v2_urls.Tags($linkQuery))
    				#if ($tagUrl)
    					<li class="breadcrumb"><a href="$core_v2_encoding.HtmlAttributeEncode($tagUrl)">$tag</a></li>
    				#end
    			#end
    		</ul>
    	#end
    #end
    
    #set ($tags = $core_v2_tags.List($query))
    #set ($sortedTags = $core_v2_tags.Sort($tags, "%{ MinimumItemsPerTag = $minimumPostsPerTag, MaximumNumberOfTags = $maximumTags, CssClasses = $cssClasses }"))
    
    #foreach ($tag in $sortedTags)
    #beforeall
    	<ul class="tag-list cloud">
    #each
    	#set ($tagName = $tag.Name)
    	#if ($showTagCounts)
    		#set ($tagName = "${tagName} ($tag.ContentCount)")
    	#end
    	<li class="tag-item ${tag.CssClass}">
    		#set ($tagUrl = false)
    		#if($linkTo != 'Nothing')
    			#set ($tagsToLink = false)
    			#set ($tagsToLink = $core_v2_tags.Current)
    			#if ($tagsToLink)
    				#set ($addIndex = $tagsToLink.Add($tag.Name))
    			#else
    				#set ($tagsToLink = $core_v2_utility.MakeList($tag.Name))
    			#end
    			#if($linkTo == 'SiteTagBrowser')
    				#set($tagUrl = $core_v2_urls.Tags($tagsToLink))
    			#else
    				$linkQuery.Remove('Tags')
    				$linkQuery.Add('Tags', $core_v2_utility.Join(',', $tagsToLink))
    				#set($tagUrl = $core_v2_urls.Tags($linkQuery))
    			#end
    		#end
    		#if ($tagUrl)
    			<a href="$core_v2_encoding.HtmlAttributeEncode($tagUrl)" rel="nofollow tag"><span></span>$tagName</a>
    		#else
    			$tagName
    		#end
    	</li>
    #afterall
    	</ul>
    #nodata
    	#if ($filterTags && $filterTags.Length > 0)
    		<div class="tag-list cloud">$core_v2_language.GetResource('TagCloud_NoSubTagsDefined')</div>
    	#elseif($noTagsText && $enableNoTagsMessage)
    		#set ($noTagsText = $core_v2_widget.ApplyTokens($noTagsText))
    		<div class="tag-list cloud">$noTagsText</div>
    	#else
    		$core_v2_widget.Hide()
    	#end
    #end]]></contentScript>
    		<headerScript><![CDATA[
    $core_v2_widget.ApplyTokens($core_v2_widget.GetStringValue('fragmentHeader', '${resource:TagCloud_Title}'))
    			]]></headerScript>
    		<configuration><![CDATA[<propertyGroup id="options" resourceName="Options">
    	<property id="fragmentHeader" resourceName="CF_Title" dataType="string" defaultValue="${resource:TagCloud_Title}" controlType="Telligent.Evolution.Controls.ContentFragmentTokenStringControl, Telligent.Evolution.Platform" />
    	<property id="applicationType" resourceName="CF_AppType" dataType="string" defaultValue="Unknown">
    		<propertyValue value="Forum" resourceName="CF_Forum" />
    		<propertyValue value="Weblog" resourceName="CF_Weblog" />
    		<propertyValue value="MediaGallery" resourceName="CF_MediaGallery" />
    		<propertyValue value="Wiki" resourceName="CF_Wiki" />
    		<propertyValue value="Unknown" resourceName="CF_Unknown" />
    	</property>
    	<property id="ignoreFilterTags" resourceName="CF_IgnoreFilterTags" descriptionResourceName="CF_IgnoreFilterTags_Description" dataType="bool" defaultValue="false" />
    	<property id="maximumTags" resourceName="CF_MaxTags" descriptionResourceName="CF_MaxTags_Description" dataType="int" defaultValue="25">
    		<propertyRule type="Telligent.Evolution.Controls.PropertyRules.MinMaxValueRule, Telligent.Evolution.Platform" minValue="1" maxValue="100" />
    	</property>
    	<property id="minimumPostsPerTag" resourceName="CF_MinPostsPerTag" descriptionResourceName="CF_MinPostsPerTag_Description" dataType="int" defaultValue="1">
    		<propertyRule type="Telligent.Evolution.Controls.PropertyRules.MinMaxValueRule, Telligent.Evolution.Platform" minValue="1" maxValue="10000" />
    	</property>
    	<property id="filterTags" resourceName="CF_TagsToFilter" descriptionResourceName="CF_TagsToFilter_Description" dataType="string" defaultValue="" />
    	<property id="logicallyOrTags" resourceName="MatchAnyTags" dataType="bool" defaultValue="false"  />
    	<property id="showTagCounts" resourceName="CF_ShowTagCount" descriptionResourceName="CF_ShowTagCount_Description" dataType="bool" defaultValue="false" />
    	<property id="enableNoTagsMessage" resourceName="CF_EnableNoTagsMessage" dataType="bool" defaultValue="false" />
    	<property id="noTagsText" resourceName="CF_NoTagsText" dataType="string" defaultValue="${resource:TagCloud_NoTagsDefined}" controlType="Telligent.Evolution.Controls.ContentFragmentTokenStringControl, Telligent.Evolution.Platform" />
    	<property id="linkTo" resourceName="CF_LinkTagsTo" dataType="string" defaultValue="ContextualTagBrowser">
    		<propertyValue value="SiteTagBrowser" resourceName="CF_SiteTagBrowser" />
    		<propertyValue value="ContextualTagBrowser" resourceName="CF_ContextualTagBrowser" />
    		<propertyValue value="Nothing" resourceName="CF_Nothing" />
    	</property>
    </propertyGroup>]]></configuration>
    		<languageResources><![CDATA[<language key="en-us">
      <resource name="AllTags">All tags</resource>
      <resource name="CF_AppType">Application</resource>
      <resource name="CF_ContextualTagBrowser">Contextual Tag Browser</resource>
      <resource name="CF_EnableNoTagsMessage">Enable No Tags Message</resource>
      <resource name="CF_Forum">Forums</resource>
      <resource name="CF_IgnoreFilterTags">Ignore Filter Tags</resource>
      <resource name="CF_IgnoreFilterTags_Description">If set to true, the tag cloud will not be filtered by tags identified in the URL. This can be useful if the tag cloud will be shown on a 'Tag Browser' page.</resource>
      <resource name="CF_LinkTagsTo">Link each Tag to</resource>
      <resource name="CF_MaxTags">Maximum Number of Tags</resource>
      <resource name="CF_MaxTags_Description">Only the most popular tags, up to the maximum number defined, will be displayed.</resource>
      <resource name="CF_MediaGallery">Media Galleries</resource>
      <resource name="CF_MinPostsPerTag">Minimum Number of Posts per Tag</resource>
      <resource name="CF_MinPostsPerTag_Description">Only tags related to this minimum will be displayed.</resource>
      <resource name="CF_NoTagsText">Text to Display when No Tags are Available</resource>
      <resource name="CF_Nothing">(Nothing)</resource>
      <resource name="CF_ShowTagCount">Show Post Count</resource>
      <resource name="CF_ShowTagCount_Description">If enabled, the number of posts referencing each tag will be shown with each tag.</resource>
      <resource name="CF_SiteTagBrowser">Site Tag Browser</resource>
      <resource name="CF_TagsToFilter">Tags to Filter by</resource>
      <resource name="CF_TagsToFilter_Description">A comma-separated list of tags to filter the tag cloud by.</resource>
      <resource name="CF_Title">Widget Title</resource>
      <resource name="CF_Unknown">(Automatically Detect)</resource>
      <resource name="CF_Weblog">Weblogs</resource>
      <resource name="CF_Wiki">Wikis</resource>
      <resource name="Core_TagCloud_Description">Displays a tag cloud.</resource>
      <resource name="Core_TagCloud_Name">Tag Cloud</resource>
      <resource name="MatchAnyTags">Match ANY of these tags</resource>
      <resource name="Options">Options</resource>
      <resource name="TagCloud_NoSubTagsDefined">Sorry, but there are no more tags available to filter with.</resource>
      <resource name="TagCloud_NoTagsDefined">No tags have been created or used yet.</resource>
      <resource name="TagCloud_Title">Related Tags</resource>
    </language>]]></languageResources>
    	</scriptedContentFragment>
    </scriptedContentFragments>

    That being said, it's worth identifying what you're trying to achieve too. With your current configuration, the Tag Cloud will show tags related to Q419TestTag, i.e. tags that are added to content also tagged with Q419TestTag. If there's only one tag in the filter list, this new option to OR or AND will not make a difference. And if you're just trying to list content tagged with Q419TestTag, the Tagged Content List widget may be what you're after, instead..

  • Thank you Michael. Any idea when this may be fixed? I really need to be able to determine content counts by product number and this is the best means to do so at the moment.

  • Unfortunately not yet, it needs to be triaged. 

    Edit: deleted a previous reply as I misstated the issue with the tag API.

  • Edit again: Do try the attached customized widget. It includes what will likely be the same fix whenever it ships in the product. The platform already supports ORing tags, but the default version of the widget just didn't expose it.