Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Some Background...

I have created a custom blog web template (which I started by copying and pasting the OOTB blog site definition) and in order to customise the way blog posts are displayed, I have to make some changes to the "blog.xsl" file.

NB: Since I am working on an Office 365 / sandbox solution, changing the "blog.xsl" in the 14 hive is definitely not an option -- nor is deploying a customised version of the file to the file system.

So I have instead created a copy of the "blog.xsl" file within Visual Studio, made my customisations to it, and deployed it to the Style Library. So far so good. The final step is just to hook up the various views in my blog lists' "schema.xml" files to point to my customised XSL file.

The Problem...

The list view's XslLink property appears to be hard-coded to point to the "14\TEMPLATE\LAYOUTS\XSL" directory. For example, the OOTB blog site definition just contains the following for its list views:

<XslLink>blog.xsl</XslLink>

Notice there is no path specified. If I attempt to put either an absolute or relative URL into this field (e.g. /Style Library/XSL/blog.xsl), an exception is thrown on the page and the following message is output to the ULS logs:

Error while executing web part: System.NotSupportedException: The given path's format is not supported.

My Question...

How do I point a list view to a custom XSL file that is deployed to the content database (as opposed to the filesystem)?

share|improve this question
add comment

1 Answer 1

You approach looks correct though I usually do this through the browser. Have you tried pointing to this XSL from a single view to confirm it works OK? Assuming it does then it is down to the way the code is expecting the format - maybe replace the space in Style Library with %20?

share|improve this answer
    
Hi Dave. If I manually copy my XSL to the filesystem on my dev machine everything works great, so there's no errors there. Obviously this won't be an option for me in prod as we have to deploy to SharePoint Online. I've also tried removing the space as you suggested, but still no luck. Plus -- I can't upload the XSL via the browser as it's part of a site template and so needs to be deployed automatically as part of the site provisioning process. –  Nick Larter Mar 16 '13 at 1:56
    
Are all the sites within a single site collection? If so then the XSLT file should be able to reside in the Style Library (or any other document library) and link to it from there. Try editing one of the pages in the browser, edit the web part and in Miscellaneous section set the XSL Link to point to your file in the Style Library. –  Dave Paylor Mar 16 '13 at 3:06
    
Yes, all sites are within a single site collection. Unfortunately though, using the browser to hook-up my custom XSL isn't a viable option because it'0s used to render my custom blog template's home page and so it needs to be setup automatically when the site is being provisioned (we can't expect end users to manually execute some steps to brand their sites properly). –  Nick Larter Mar 21 '13 at 8:37
    
Yes, I understand. Then this has to be referred to a developer rather than me I am afraid. Good luck –  Dave Paylor Mar 21 '13 at 11:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.