0

Simple question but I just couldn't find a simple answer. I want to add a little piece of css / javascript code to the AllItems.aspx view of a custom list upon deployment. I know how to get it there via Designer, I know how to create a listview and set the column and stuff in the xml schema file, but I don't know where to put my additions.

1

I found the answer in the way you can deploy a custom NewForm.aspx page. Deploying modifications to the AllItems page takes the same approach.

  1. Copy the file found in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\Pages\viewpage.aspx into your solution. This is the file that's being used by SharePoint as AllItems.aspx as long as you don't make any changes (otherwhise it's ghosted into your content database).
  2. Make the changes you want to
  3. Change the schema.xml file and swop

SetupPath="pages\viewpage.aspx"

with

Path="CustomAllItems.aspx" (or whatever you named the file)

  1. Make sure your new file is listed as an ElementFile in the element.xml file, so it actually get's deployed to the feature directory.

That's it!

0

I faced a similar situation not long ago.

What I did was that I took a copy of the list's AllItems.aspx pasted it into my solution, made the modifications that I needed and then created a feature in which I pointed at the specific list and programmatic switched out the existing AllItems.aspx with my "custom" version of it.

list.DefaultDisplayFormUrl = URL to the new display form here;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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