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

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.

share|improve this question

2 Answers 2

up vote 1 down vote accepted

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!

share|improve this answer
    
Made a blog post about this with further instructions: blog.repsaj.nl/?p=379 –  Jasper Oct 21 '11 at 9:10

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;

share|improve this answer

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.