问题
I am using the WeBlog module in Sitecore 7.1. After years of blog posts, the tag cloud control now shows a huge list of all the tags which have ever been used in a post. Is it possible to restrict the number of tags which show or provide a minimum threshold for the number of times each tag needs to have been used?
I can't find any information in the documentation or within the Sitecore content editor, but I assume it must be a common problem.
回答1:
From what I know there is no way of limiting the number of tags in the TagCloud
sublayout out of the box.
However you can create your own CustomTagManager
class, inherit from Sitecore.Modules.WeBlog.Managers.TagManager
and override the implementation of the GetAllTags()
method to get only first N tags.
When you have your CustomTagManager
, just register it in WeBlog.config
file instead of this line:
<setting name="WeBlog.Implementation.TagManager" value="Sitecore.Modules.WeBlog.Managers.TagManager"/>
回答2:
I don't think it does this out of the box and by default it get's all the tags.
As WeBlog is open source and on Github you could fork your own version and modify it to your requirements.
Here's the part where the Tags are rendered in the side bar:
https://github.com/WeTeam/WeBlog/blob/3da28ffd1431bdec27fa0ef2775701807015c60f/Website/layouts/WeBlog/Sidebar/TagCloud.ascx.cs
来源:https://stackoverflow.com/questions/35574268/is-it-possible-to-restrict-the-number-of-items-show-in-weblog-tag-cloud-within-s