SharePoint 2013 |搜索精炼机更改字符数 [英] SharePoint 2013 | Search Refiners change number of characters

查看:50
本文介绍了SharePoint 2013 |搜索精炼机更改字符数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

We are trying to show the full refiner but they are either cut off with ... OR wrap below the individual select box. It is my understanding that there was a "number of characters to show" on the refiners web part in 2010 but what is the resolution for 2013?? BTW - changing the width of the left column does not effect how many characters show.

示例屏幕:

推荐答案

作为解决方法,我们可以为精简程序自定义显示模板,以限制字符数.
详细信息如下:
打开显示模板的目录以进行优化.

As a workaround, we can customize a display template for the refiner where to limit the characters’ number.
Here are the details:
Open the directory of Display Templates for refiner.

已打开本地目录,现在我们必须导航到此目录,该目录用于我们的精炼机显示模板位于以下位置:
\ _catalogs \母版页\显示模板\过滤器

A local directory is opened, now we have to navigate to this directory where our Display Templates for refiners are located here:
\_catalogs\masterpage\Display Templates\Filters

上面的屏幕快照显示,我们为精炼机使用了名为多值精炼项目"的显示模板.为了限制字符数,我们必须对此显示模板进行一些更改.在上面提到的目录中,我们可以找到html 显示模板的文件.

Above screenshot shows that we use the Display Template named Multi-value Refinement Item for our refiner. In order to limit the characters’ number, we have to do some changes to this Display Template. In the above directory mentioned we can find the html file for this Display Template.

使用Visual Studio打开此html文件(您可以使用任何喜欢的编辑器打开此文件).

Open this html file with Visual Studio (you can use whatever editor you like to open this file) .

为了安全起见,我们不会直接修改此文件.或者,我们必须同时复制此文件和上面的屏幕快照中指定的JavaScript文件.我们创建一个名为custom08的新文件夹来存储和重命名这两个文件,即html文件和JavaScript. 文件.

For safety, we don’t modify this file directly. As an alternative, we have to copy both this file and the JavaScript file specified in above screenshot. We create a new folder titled custom08 to store and rename the two files, a html file and a JavaScript file.

现在,我们必须根据我们的要求对其内容进行编辑.
在Custom_Filter_MultiValue.html

Now, we have to edit their content according to our requirements.
In Custom_Filter_MultiValue.html

在Custom_Filter_MultiValue_Body.js中,我们将字符长度限制为20个(包括省略号),并用"..."显示其他字符.

In Custom_Filter_MultiValue_Body.js, we limit the length of characters to 20 (including the ellipsis) and show the additional characters with "…".

保存两个文件,然后重新编辑优化程序Web部件.选择我们刚刚定制的显示模板.保存并应用所有配置.

Save the two files, and re-edit the refiner web part. Select the Display Template we just customized. Save and apply all the configuration.

现在,刷新页面.

最好的问候,

John Han


这篇关于SharePoint 2013 |搜索精炼机更改字符数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆