SharePoint 找不到我的自定义渲染模板
因此,我创建了一个自定义 RenderingTemplate 并将其部署到 CONTROLTEMPLATES\MyControlTemplates\
它基本上规定了我创建的自定义内容类型在显示时应如何呈现。 为此,我添加了以下内容:
<FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
<Display>CustomDispForm</Display>
</FormTemplates>
但是,当我的自定义 RenderingTemplate 位于 CONTROLTEMPLATES 的子目录中时,SharePoint 找不到它。 但如果我将其移至 CONTROLTEMPLATES\ SharePoint 的根目录,就会找到它。
根据文档,SharePoint 还应该查看子目录,但情况似乎并非如此。 那么这可能是一个错误吗? 我想看看我是否错过了一些东西,因为我真的更喜欢将自定义内容放在 root/
谢谢。
So I've created a custom RenderingTemplate and deployed it to CONTROLTEMPLATES\MyControlTemplates\
It basically dictates how a custom content type that i've created should be rendered when displayed. For that I've added this:
<FormTemplates xmlns="http://schemas.microsoft.com/sharepoint/v3/contenttype/forms">
<Display>CustomDispForm</Display>
</FormTemplates>
However, SharePoint does not find my custom RenderingTemplate when it's located in a subdirectory of CONTROLTEMPLATES. But if I move it to the root of CONTROLTEMPLATES\ SharePoint will find it.
According to documentation SharePoint should also look in subdirectories but this seems not to be the case. So is this a bug maybe? I'd like to see if I've missed something because I really prefer putting custom stuff in root/<Custom> directories.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
将控件模板放入自定义目录时,我注意到了相同的行为。 你是对的,SharePoint 默认情况下也应该在子目录中查找(目前我无法确定配置文件中的确切位置),但它似乎并没有这样做。
我以编程方式加载了我的模板,也许这也是您的一个选择? 您可以在此处找到更多信息: http://www.reversealchemy.net/2008/09/01/loading-sharepoint-templates-from-a- Different-location/
问候,
埃里克
I have noticed the same behaviour when putting control templates in a custom directory. You are right, SharePoint is supposed to look in subdirectories by default as well (the exact location in the config files eludes me at the moment) but it does not seem to do so.
I loaded my templates programatically, perhaps this is an option for you as well? You can find more information here: http://www.reversealchemy.net/2008/09/01/loading-sharepoint-templates-from-a-different-location/
Regards,
Erik