Wednesday, August 26, 2009

Using own xsl style sheet

For this month I have been working on SharePoint, building an internet site, having built an intranet site at the start of the year now starting this I had forgotten a lot of what learnt so this time I'm going to blog it here (until I move to own site).

Well I added a Content Editor Web Part (or CEWP or should that be Webpart) to my page and modify it to pull the correct datasource all simple and through the webpage.

Now I need to customise it... Two things need to do firstly get it to display my custom fields and secondly use my own style sheet. The second is to avoid changing the default itemstyle.xsl.

I created a xsl and added a testing template to it (in another post)

Now export the CEWP; you can now open this file with Notepad.

Look for the property called "ItemXslLink" and modify it to point to own style sheet:
" <property name="ItemXslLink" type="string">/Style Library/XSL Style Sheets/Internet.xsl</property>"

Then look for "CommonViewFields" and add your custom fields:
" <property name="CommonViewFields" type="string">ShareholderDetails, Text;URL, URL</property>"

Now save it, delete the one on your Web Part Page and import this modified version.

Now your webpart will display the extra fields need and use own styles.

More sharepoint posts to follow

No comments:

Post a Comment