CSWP - 外部模板参考 [英] CSWP - External Template Reference

查看:63
本文介绍了CSWP - 外部模板参考的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1)显示模板库没有.html文件。

1) The Display template libraries didn't have the .html file.

2)获得了"外部模板参考"在CSWP的"编辑Web部件"窗格中。

2) Was getting the "External Template Reference" in the Edit Web Part pane for the CSWP.

3)重新激活发布功能 - 没有.html文件

3) Re-Activated the Publishing Feature -- no .html files

4)复制来自其他网站集的.html文件。

4) Copied the .html files from another site collection.

5)修改  ab  .html 文件以查看是否会生成新的.js文件(不是)。

5) Modified ab .html file to see if a new .js file would be generated (it was not).

6)使用母版页库UI检查属性 - 与其他有效的网站集进行比较时看起来很好。

6) Checked the properties using the Master Page Gallery UI - it looks fine when compared against another site collection that works.

7)即使使用.html和.js文件到位后,CSWP Web部件编辑器显示"外部模板参考"。 - 仅显示该视频和视频。 

7) Even with the .html and .js files in place, the CSWP web part editor shows the "External Template Reference" -- only that and video are display. 

看起来CSWP正在从我修复它的地方以外的地方获取输入(视频在所有修复之前就已存在,现在就在那里)..这站点可能是从模板创建的。 (.stp)被移动 - 很久以前我就在这里.. TIt
看起来没有事件处理程序位于母版页库中以生成.js文件。

It looks like the CSWP is getting input from someplace other than where I've fixed it (video is was there before all the repairs and it's there now).. This site may have been created from a template. (.stp) that was moved -- long before I was here.. TIt looks like there is no event handler sitting on the master page gallery to generate the .js files.

 任何人都有关于如何解决这个问题的建议???

 ANyone have a suggestion on how to fix this ???

所有科学都是物理或集邮

All science is either physics or stamp collecting

推荐答案

你好GUYO,

Hi GUYO,

您是如何生成"外部模板参考"的?

How did you generate the "External Template Reference"?

内容搜索Web部件的显示模板的路径位于:

The path of the display template for the content search web part is located:

转到网站设置 - >网页设计器库 - >母版页和页面布局 - >显示模板 - >内容网络部件。

Go to site settings->Web Designer Galleries->Master pages and page layouts->display template->Content web parts.

如果您将.html文件上传到内容Web部件,它将生成.html文件的.js文件。

If you upload the .html file to the content web part, it will generate the .js file for the .html file.

更多参考:

自定义内容搜索Web部件 - 第2部分 - 使用JavaScript自定义显示模板。

Customising the Content Search Web Part – Part 2 – Custom Display Templates with JavaScript.

https://www.martinhatch.com/2013/08/customising-content-search-web-part.html

内容搜索WebPart和显示模板。

Content Search WebPart and Display Templates.

https://cann0nf0dder.wordpress.com/2013/02/20/content-search-webpart-and-display-templates/

祝你好运,

Sara Fan


这篇关于CSWP - 外部模板参考的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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