代码之家  ›  专栏  ›  技术社区  ›  Philipp Schmid

安装自定义ASPX文件作为ListTemplate定义的一部分

  •  0
  • Philipp Schmid  · 技术社区  · 15 年前

    我使用vsewss 1.3来 创建自定义列表定义 作用域为“site”。

        <Elements Id="8924acef-84ef-4584-ade4-e3eaeb8df345" xmlns="http://schemas.microsoft.com/sharepoint/">
    
      <ListTemplate Name="MyListDefinition"
                    DisplayName="MyList"
                    Description=""
                    BaseType="0"
                    Type="10888"
                    OnQuickLaunch="TRUE"
                    SecurityBits="11"
                    Sequence="410"
                    Image="/_layouts/images/itgen.gif" />
    
      <CustomAction
        Id="MyList.Print"
        Location="Microsoft.SharePoint.StandardMenu"
        GroupId="ActionsMenu"
        Title="Print MyItem"
        Description="Print Empty copies of this form."
        RegistrationType="List"
        ControlAssembly="MyList, Version=1.0.0.0, Culture=neutral, PublicKeyToken=de6e0316a726abcd, processorArchitecture=MSIL"
        ControlClass="MyList.PrintActionMenu" />
    
      <Module Name="ActionPages" Url="">
        <File Url="PrintForm.aspx" Type="Ghostable" Path="MyListDefinition\PrintForm.aspx" />
      </Module>
    </Elements>
    

    文件“printform.aspx”已正确安装在下面的服务器上 …\12\模板\功能… 但是 它不会出现 在预期的URL下 http://localhost/site/lists/listname/PrintForm.aspx 安装列表模板并使用此模板创建新列表实例后。

    我怀疑我的listDefinition.xml文件(如上所示)中的和/或标记缺少正确的属性。

    2 回复  |  直到 15 年前
        1
  •  0
  •   Colin    15 年前

    您还应该有一个schema.xml,在schema.xml中应该有如下内容:

    <Forms>
      <Form Type="DisplayForm" Url="DispForm.aspx" WebPartZoneID="Main" />
      <Form Type="EditForm" Url="EditForm.aspx" WebPartZoneID="Main" />
      <Form Type="NewForm" Url="NewForm.aspx" WebPartZoneID="Main" />
      ...... your form here
    </Forms>
    

    另外,请尝试使用SharePoint解决方案生成器导出现有列表(与VSEWS一起提供),它将为您提供完整的XML定义。你可以用它作为参考。

    p.p.s.在评论中发布的链接中,它声明文件应该在如下功能中注册:

    <ElementFile Location="GenericList\schema.xml" />
    <ElementFile Location="GenericList\DispForm.aspx" />
    <ElementFile Location="GenericList\EditForm.aspx" /> 
    <ElementFile Location="GenericList\NewForm.aspx" /> 
    <ElementFile Location="GenericList\AllItems.aspx" />
    
        2
  •  0
  •   Rich Bennema    15 年前

    如果它在任何地方,我希望当模块元素的URL为空时,printform.aspx会显示在网站的根文件夹中。试试这个:

      <Module Name="ActionPages" Url="lists/listname">    
            <File Url="PrintForm.aspx" Type="GhostableInLibrary" Path="MyListDefinition\PrintForm.aspx" />  
      </Module>
    

    另外,尝试将ghostableinlibrary作为文件类型,而不是ghostable。

    最后,您提到printform.aspx确实在某些特性中出现,但没有给出完整的路径。请确保它位于“…\12\template\features\yourFeaturesName\MyListDefinition\printform.aspx”中。根据path属性的值,printform.aspx需要位于特性中名为mylistdefinition的目录中。