SharePoint2010 如何用Designer自定义WebPart样式
如题 SharePoint2010 如何用Designer自定义WebPart样式
我用Moss管理中心新建了默认的“工作组网站”但我不知道如何去通过 SharePoint Designer
去自定义WebPart显示样式?请大虾帮忙!
[解决办法]
Using SharePoint Designer 2010 you can create nice looking user interface renderings of data stored within lists and libraries without any custom coding by replacing the out of the box XSLT with your own custom XSLT. To get started, you need to take a couple simple steps to enable this advanced functionality in SharePoint Designer.
1.Open a site in SharePoint Designer. You will need at least one web part page available in order to create a web part with custom XSLT. If you are in a publishing site you will need to create a web part page because you cannot edit the content of a publishing page using SharePoint Designer.
2.Locate your test web part page and open it for editing in SharePoint Designer.
3.On the Home tab click on the Advanced Mode button in the ribbon bar.
4.Click in a web part zone and then from the insert tab select the Data View drop down and choose the list or library you wish to use as your data source.
5.Select the newly created web part and in the Design tab under the List View Tools grouping, click on the Customize XSLT drop down and select Customize Entire View.
6.You can now switch to the code view for the page and modify the XSL.
7.Once you have finished modifying your web part you can save the page and then export your web part. This new web part can be used anywhere within the site that contains the source data list or library.
Based upon my testing you must include the following in your XSL or you will receive an “Unable to display this Web Part” error.
<xsl:include href=”/_layouts/xsl/main.xsl” />
SharePoint uses the main.xsl as the core XSL file for providing the defaul schema independent rendering of list and library views. Even if you are writing your own XSL it appears that SharePoint still needs access to pieces of that XML.