2009-06-30 94 views
1

我需要创建一个将创建一些内容页面的SharePoint功能。我知道如何为文档库创建ListInstance元素,但是如何将Web部件页面添加到列表中?如何创建将Web部件页面添加到文档库的SharePoint功能?

我用Web UI(_layouts/spcf.aspx)创建了一些页面,但是如何在我的ListInstance中使用它们?有没有办法导出这些内容并在我的功能中使用它?或者,我有不同的方式来解决这个问题?

回答

1

恐怕您将无法使用ListInstance功能,ListInstance将只允许您基于现有列表模板创建列表。但是您可以尝试为列表创建一个新的模式,并且您需要在List的schema.xml中执行此操作。在schema.xml文件的结尾处,您将看到如下条目:

<Forms> 
    <Form Type="DisplayForm" Url="DispForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /> 
    <Form Type="EditForm" Url="EditForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /> 
    <Form Type="NewForm" Url="NewForm.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /> 
</Forms> 

这决定列表中包含的表单列表。您需要添加另一种形式,你可以为例如

<Form Type="NewForm" Url="NewForm2.aspx" SetupPath="pages\form.aspx" WebPartZoneID="Main" /> 

你会得到另一个页面NewForm2.aspx,UI将按照文件form.aspx存在于位置下再录入说:\ PROGRAM Files \ Common Files \ microsoft shared \ Web Server Extensions \ 12 \ TEMPLATE \ Pages,您可以复制form.aspx并对其进行更改并将SetupPath url指向新文件。如果你想创建一个新的视图页面,你可以使用Schema.xml的标签来实现。

+0

我想要做的是创建“Web部件页面”,就像你可以在Web UI的创建新网页部分页面页面(_layouts/spcf.aspx)。这是你的意思是“查看页面”?我已经看过MSDN上的View Schema(http://msdn.microsoft.com/en-us/library/ms439798.aspx),并不认为这是我想要的。 – Joosh21 2009-07-01 14:14:48

相关问题