R – Sharepoint: Modify the page template of views

schemasharepointtemplatesviews

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.

Best Answer

Check out this blog:

http://weblogs.asp.net/soever/archive/2006/11/11/SharePoint-Solution-Generator-2D00-part-1_3A00_-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.

Related Topic