views:

196

answers:

1

Hi

I have a sharepoint list with several views. I can modify the view pages (such as AllItems.aspx) via the sharepoint designer. However I would prefer to modify the underlying template instead.

Now I could directly modify the default view page template located in templates\pages\viewpage.aspx but this would affect the whole sharepoint installation.

I would rather make a copy of this template and make my list (or views) point to it. Is there a way I can accomplish this?

Note: The list/views were created via the Web UI without any custom XML.

+1  A: 

Check out this blog:

http://weblogs.asp.net/soever/archive/2006/11/11/SharePoint-Solution-Generator-%5F2D00%5F-part-1%5F3A00%5F-create-a-site-definition-from-an-existing-site.aspx

Basically, use the sharepoint solution generator to create a VS solution of your SharePoint list. The solution will contain a file called schema.xml that defines the list and associated views. You can then customize the aspx pages like viewlist.aspx and point the schema at your custom pages. When you deploy the solution/feature it will deploy your custom pages with it.

There's really a wealth of info out on the internets, it's just difficult to find when you don't know what you're looking for. But this should get you started in the right direction.

Also, in my experience, once you create the solution you should port it (read: copy teh contents) into an STSDEV project. STSDEV really shows you what's happening behind the scenes, whereas the other VS tools for SP development can do some hand-waving magic which will leave you in the dark when things go wrong. Just my 2 cents.

Daniel
Thanks for the hint. I generated a solution from my existing list and modified the schema.xml: There I added the attribute SetupPath="pages\custom_viewpage.aspx" to my views and deployed it. However it seems that all views still point to the default viewpage. Any ideas?
driAn
Just to verify a few things... 1. Did you add custom_viewpage.aspx to your hive, in the pages folder?2. When you create your list, is your custom_viewpage being deployed? You can check this in sharepoint designer, by navigating through the tree. Depending on what your custompage looks like you might need to create a renderingtemplate. It may be helpful if you post your CustomViewPage. Also, keep in mind that everytime you change the schema you need to create a new list so that any new content (like your custom view page) is redeployed correctly.
Daniel
1. Yes, I safed my custom_viewpage.aspx in the pages folder 2. The custom_viewpage is currently deployed manually (xcopy) without any sharepoint solution package.No, the file is not visible in SP designer, where should it be located? I thought the pages\ folder is not visible through the SP designer.The file itself is almost the same as the original one, plus a few modification (nothing big).
driAn
schema.xml defines a template for a list. When you create the list of the type defined in the template, the custom page is deployed as part of the list. So when you go to SP designer, expand your site, and then your list and you should see the custom page deployed. I'm wondering if what you really want to change is the Rendering Template which is what gets rendered in the main zone of the web part. Either way the first step is making sure your custom changes to custom_viewpage.aspx are visible in SPDesigner.
Daniel