Is it possible to restrict the number of items show in WeBlog tag cloud within Sitecore?

爱⌒轻易说出口 提交于 2019-12-24 12:17:14

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!