SharePoint 2013在单个页面上的多个搜索框 [英] SharePoint 2013 multiple search boxes on a single page

查看:95
本文介绍了SharePoint 2013在单个页面上的多个搜索框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在单个SharePoint 2013页面上拥有多个独立搜索框?  我的情况是:

How can I have multiple independent search boxes on a single SharePoint 2013 page?  My scenario is this:

1。搜索框1已添加到母版页

1. Search Box 1 is added to the master page

2。搜索框2位于专用搜索页面以及搜索结果Web部件。

2. Search Box 2 is on a dedicated search page along with a search results web part.

搜索框1是代码段库中导航部分的搜索框。  它是较小的SharePoint搜索框。

Search Box 1 is the search box from the navigation section in the Snippets Gallery.  It is the smaller SharePoint search box.

搜索框2是添加到页面上的Web部件区域的搜索Web部件。  它也是大型SharePoint搜索框。  

Search Box 2 is a search web part added to a web part zone on the page.  It is also the large SharePoint search box.  

当在专用搜索页面上,并且在搜索框2中输入搜索词时,搜索词被"输入"。在两个搜索框中。  完全打破体验的真正问题是,同一个CSS应用于页面上的两个搜索框
。  因此较小的搜索框(搜索框1)获取CSS类".ms-srch-sbLarge""动态应用于它。  此外,我们注意到包装搜索框的div都获得了"SearchBox1"的ID。  我
添加了一个前后图像来说明问题。  

When on the dedicated search page, and a search term is entered into search box 2, the search term is "entered" in both search boxes.  The real issue, which totally breaks the experience, is that the same CSS is applied to both search boxes on the page.  So the smaller search box, search box 1, gets the CSS class ".ms-srch-sbLarge" dynamically applied to it.  Additionally, we noticed that the divs wrapping the search boxes both get the ID of "SearchBox1".  I have added a before and after image to illustrate the problem.  

2013年5月9日 -  

5/9/2013 - 

我还有一些信息要添加到此问题中。   SearchBox2正在使用显示模板。首次呈现页面时,与显示模板关联的control_searchbox.js文件正确获取SearchBox2的控件ID。  但是,当
在SearchBox2中输入搜索词时,而不是保留它在页面加载时找到的控件ID,而不是保留在DOM中获取"控件"的模板类型的控件ID。以及"搜索框"的TargetControlType。  它找到了它的第一个
,它是主页面中的一个,并用它自己的标记覆盖SearchBox1,它是针对SearchBox2的。

I have some more information to add to this issue.  SearchBox2 is using a display template. The control_searchbox.js file associated with the display template correctly gets SearchBox2's control ID when the page is first rendered.  However, when a search term is entered in SearchBox2, rather than preserve the control ID it found on page load, control_searchbox.js  parses the DOM for a TemplateType of "control" and a TargetControlType of "searchbox".  It finds the first one it comes to, which is the one in the master page and overwrites SearchBox1 with it's own markup, which is targeted for SearchBox2.

Microsoft - 这似乎是SharePoint中的一个错误。  我们怎样才能解决此问题?

Microsoft - this would seem to be a bug in SharePoint.  How can we get a fix for this?

推荐答案

我们也遇到了这个问题,正在寻找解决方案。
We are also having this issue, and am looking for a solution.


这篇关于SharePoint 2013在单个页面上的多个搜索框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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