How can I add my own custom webparts to a page layout in SharePoint? I've exported the webparts and have a .webpart file. I tried importing them into the SharePoint designer without any success. I've read a little on the AllUsersWebPart... but I'm not really sure how this works.
如何将自己的自定义Web部件添加到SharePoint中的页面布局?我已导出webparts并有一个.webpart文件。我尝试将它们导入SharePoint设计器但没有任何成功。我在AllUsersWebPart上读过一些内容......但我不确定这是如何工作的。
Thanks.
1 个解决方案
#1
try adding the code from the .webpart into the layout directly. (e.g. open in notepad copy-paste into SharePoint designer).
尝试直接将.webpart中的代码添加到布局中。 (例如,在记事本中打开复制粘贴到SharePoint设计器中)。
Note: You should look up examples already in some layout pages as there are a few minor changes required to the webpart format (I vaguely recall).
注意:您应该在一些布局页面中查找示例,因为webpart格式需要进行一些小的更改(我模糊地回忆一下)。
Be sure to version your layout pages as SharePoint designer can sometimes take liberties with your code and stuff the page up (and refuse to load/save it ever again). If this happens, use the web site to revert the page to a previous (working) version.
确保对布局页面进行版本设置,因为SharePoint设计人员有时可以*地使用您的代码并填充页面(并拒绝再次加载/保存)。如果发生这种情况,请使用网站将页面还原为以前的(工作)版本。
#1
try adding the code from the .webpart into the layout directly. (e.g. open in notepad copy-paste into SharePoint designer).
尝试直接将.webpart中的代码添加到布局中。 (例如,在记事本中打开复制粘贴到SharePoint设计器中)。
Note: You should look up examples already in some layout pages as there are a few minor changes required to the webpart format (I vaguely recall).
注意:您应该在一些布局页面中查找示例,因为webpart格式需要进行一些小的更改(我模糊地回忆一下)。
Be sure to version your layout pages as SharePoint designer can sometimes take liberties with your code and stuff the page up (and refuse to load/save it ever again). If this happens, use the web site to revert the page to a previous (working) version.
确保对布局页面进行版本设置,因为SharePoint设计人员有时可以*地使用您的代码并填充页面(并拒绝再次加载/保存)。如果发生这种情况,请使用网站将页面还原为以前的(工作)版本。