views:

1303

answers:

5

Right now I have a visual studio project which contains a custom content type that I made. It also contains all the necessary files for making a sharepoint solution (wsp) file and a script to generate this.

Now, I would like to do 2 things.

First, I'd like to create a custom display form for the content type and include it in my solution so that it is automatically deployed when I deploy my solution. How do I include this in my solution and make my content type use it?

Secondly, you can query this type with the CQWP. I've thought about exporting it, adding more common view fields, and then modifying the XSL that is used to render it. How do I include this into my solution so that it is also deployed. I know i can export the CQWP webpart once it's all setup and include it in my project as a feature. But what abuot the XSL?

Looking forward to see your suggestions, cheers.

Did as described in the first answer. Worked like a charm.

+1  A: 

Use STSDev to create the solution package. That should help with creating the WSP. The custom form, CQWP webpart and the .xls file should also be deployable within the project.

To deploy the xslt, your feature will have an

<ElementManifest Location="mywebpartManifest.xml">

This then points to a files such as

<Elements xmlns="http://schemas.microsoft.com/sharepoint/"&gt;
  <Module Name="Yourfile.xslt" Url="Style Library" Path="" RootWebOnly="TRUE">
    <File Url="yourfile.xslt" Type="GhostableInLibrary" />
  </Module>
</Elements>

for the webpart:

<Module Name="myWebpart" List="113" Url="_catalogs/wp" RootWebOnly="FALSE">
   <File Url="myWebpart.webpart" Type="GhostableInLibrary" />
</Module>

Now that file will need to be contained in the solution manifest.xml. This is done automatically from the STSDev project.

e.g.

<Resources>
    <Resource Location="SimpleFeature\Feature.xml"/>

The actual schemas are:

Site

Solution

Feature

and a link to someone else with the issue

Nat
A: 

But where in the folder structure do you deploy the form and the .xsl to?

mortenbpost
A: 

Very good thanks, I'll give this a shot.

mortenbpost
A: 

I have followed your guide and although it deploys the xslt to the feature in 12 Hive it does not place it in the correct style library folder

A: 

You need to deactivate / reactivate the feature. This will give you any error messages that are associated with copying the file over.

Daniel