I was recently tasked with migrating code that was written for 2007 in a feature. The files that were originally provisioned in the feature we deployed to the root folder of the feature. The code had already been upgraded to SharePoint 2010. I needed to create a wsp using Visual Studio 2010 and package it as a feature. Out of the box when you create a new Module in VS 2010 you get a subfolder so for example you create the feature called Feature1 and a module called Mod1. The default deployment path is 14\templates\features\feature1\mod1\file.txt. What I needed was feature1\mod1\file.txt. I tried modifying all the attributes in the elements.xml file and was not able to get the files to the correct location.
In the end what i did was the following
- Add the file to the module in visual studio
- Look at the properties of the file in visual studio
- Under Deployment Location expand the + and clear the Path value.
- Ensure that the Deployment Type is Element File
- Deploy the file and it should be in the correct location.
The deck for my SharePoint Saturday New Hampshire has been posted to SlideShare. Thanks to everyone who came to my session.
A client of ours wanted to use the preview pane for a list view. The default view of the preview pane has the right hand pane blank. You need to select an item or hover an item from the left pane to populate the right pane. The client wanted the right hand pane to have the right hand pane default to first item in the list.
It looks like when people are doing a copy and paste of the code that the double quotes ” are getting converted to smart quotes. When you copy and paste make sure that you change any of the single or double quotes to plain text.
- On the list view page (e.g. allitems.aspx) att ?ToolPaneView=2 to the query string. Replace ? with & if there are already properties in the query string.
- Under the page tab click edit page
- Add a content editor web part to the page above the list items web part.
- Click inside the content editor web part where is says add new content.
- From the ribbon select Edit HTML Source
- In the resulting pop up window paste the following code.
$(‘div.ms-ppleft table tr td.ms-vb-title’).first().trigger(‘onfocus’);
- Stop editing the page.
- The preview pane should now default to the first item in the list.