Sharepoint 2007 Custom List Templates - sharepoint

Hi I am wanting to create a little tutorial on how to create a webpart that I have added to one of the website's I have created.
I know that there is the List Templates gallery in which I could use to give this part as a file however I am using Site Columns.
Due to this will this cause errors when importing to a new Site?
Will the user need to create the Site Columns previously and will they automatically be used once importing my Custom List file?
or will when it is imported the column appear?
I don't currently have another site to test this on as yet so was wondering if anyone here already knew the answer for this?
Any light that can be shed on this question is very much appreciated and thanks in advance as well =]

I am totally confused by your question. How are List Templates gallery and a custom webpart related ?
Probably you meant site Template Gallery ?
What you need to do is :
- Create a solution package
- Create two features - one for your custom columns and custom webpart
- Optionally create a list template feature to define the columns in the list.

If this is truly a list template (you created it by going into List Settings and selecting Save As Template), then the site columns, content type, and list schema should all be contained in the manifest.xml file inside the stp file. You should not need to create anything manually to generate a list based on a template uploaded to the List Templates Gallery.
If this is a list definition feature, then you should create features that define the site columns, content type, and the list definition. The users can manually create site columns that match on name, type, and just about every other attribute, except the one that matters most - ID. Each time a site column is created in the browser, it will be assigned a different ID. That ID will not match what you have defined in your list definition.

Related

Sharepoint online use the same new/display/edit forms for two or more libraries

I'm trying to develop a Sharepoint online site to show inventory of every departments. Since I have several thousands of items, I separate the items into several libraries by departments. Each library will have the same columns.
Currently, I'm facing a problem of how to standard the new/display/edit forms for all libraries. Of cause I can use library template to do so. But what if I need to update the form, e.g. add a reference link or change the layout? Then I need to modify the form one by one for each library.
Is there any solutions that I can create one master form so that (1) it can be applied to two or more libraries, and (2) whenever the master form is changed, the change is automatically applied to the libraries?
Thanks
This is a great use case for Content Types.
At the Site Settings level, Create the columns you want. Then create the Content type you want, called "Inventory" for example. Add the columns to that Content Type.
Add the content type to each library.
Library Settings -> Advanced Settings -> Allow Management of Content Types
Remove the default content type from the library settings page
Now, you can update the columns at the site Content Type level, and it will publish to and update each library.

How to edit a list template in SharePoint 2010?

I have made a number of lists using custom list template in SharePoint 2010. I would like to add a column to each of these lists. Microsoft offers the following super helpful instructions
Edit the list template properties
On the Site Actions menu , click Site Settings.
NOTE On a site for which the Site Actions menu is customized, point
to Site Settings, and then click the settings that you want to view.
In the Galleries column, click List templates.
NOTE This option
appears only to users who have the Manage Lists permission. Site
owners have this permission by default.
The List Template Gallery page appears.
In the Edit column, click Edit Document Properties for the list
template that you want to edit.
Edit the information that you want to
change, and then click OK.
What they neglect to mention is that this gives you access to exactly 3 things
the template file ( eg: myTemplate.stp )
the template name
the template description
My question is, how do you ACTUALLY EDIT THE TEMPLATE? ie: change columns
I van crack open the file itself by downloading the .stp renaming it to a .cab extracting the .xml and making changes there. But without some testing I have no idea what will happen if I try re-compressing that file and replacing an existing template with it.
Has anyone done this themselves? Does anyone know of an alternative method to add a column to a list template?
You can create a List using the template, make the edits, then create a new template from the List you just created.
If you need the template to carry the same name, you can deactivate and delete the original, then save the new template with the proper name.
In SP2003 I used to download the STP file, rename it to CAB, edit the inner XML manually, repackage with Makecab and upload the new STP file back to the template gallery.
However I must say that in SP2010 I can't seem to get what I want (a custom URL column calculated from other columns) without SP throwing fits, so I wish you luck.

sharepoint copy a list to a different web

how can i copy a sharepoint list with all its data to a different web?
is there an stsadm command to do this?
or even through the gui.
What you can do is Save that List as Template with the contents included and create a List Based on the save template.
To Save the List as Template you need to navigate to the List Settings Page and Select Save as Template, check the "include content" check box. Enter a Name for the template and say Okay. Next time when you try to create the list you will see the saved template and you can create list using that.
You can also take that saved template from the List Template Gallery and add it to different application / site collection.
You can also do this with Gary LaPointe's stsadm extensions. They're pretty sweet. Specifically, look into the gl-copylist command.

Custom SharePoint List View - can I put it in a feature (WSP)?

Here's my situation:
I'm working in SharePoint 2007 Enterprise, I have a feature that creates a list for me when I deploy and activate it. My usual workflow thus far has been to deploy the solution, activate it, then open up SharePoint Designer to customize the list.
My customizations are typically pretty complex, but I'll keep things simple. In this case, let's just say that I edit AllItems.aspx, convert the data view to an XSLT data view, then I add one column with static text.
I've used a few different tools (SPSource, VSeWSS, SharePoint Manager, OCDExportList, etc) to extract my custom schema.xml and all the default views, but I have yet to have any luck figuring out where the the code for AllItems.aspx is now that it's been customized.
When I extract (using any of the tools above) AllItems.aspx is no different than the default. The <View> element in schema.xml is reduced to one line, for example:
<View DefaultView="TRUE"
MobileView="TRUE"
MobileDefaultView="TRUE"
Type="HTML"
FPModified="TRUE"
DisplayName="All Documents"
Url="Forms/AllItems.aspx"
Level="1"
ContentTypeID="0x" />
I'm really stuck here... I've got no clue what to do. Is it even possible? It would save me a great amount of time (and documentation) if I could include my customizations in my feature.
If there's any other info I'm missing that would help, let me know... thanks!
Latest findings:
I've found out a bit more in the past couple hours. If I save the list as a List Template, then save the .stp file locally as a .cab file I can extract its contents. One of the files is manifest.xml which contains the schema.xml as well as a few other sections.
One of those sections is a <webparts> section that has a <webpart> for each view. Each of those <webpart> elements contains a really long string of characters... no clue what those characters actually represent.
The important thing is that I think any custom views have to actually be Web Parts if deployed as part of a solution... but I'm not positive.
I have faced a similar issue a while ago. I had to create a very customized view and I had to give up the ListFormWebPart completely, and have created my own webpart to render the data.
Generally, when you customize the aspx file in SPDesigner, all your changes will be in the aspx file itself. Open it in SPDesigner and you will see there all the changes you have made. After you have converted to the XSL Data View, the standard ListFormWebPart is replaced by a DataFormWebPart, which doesn't care about the <View> tags specified in the schema.xml; Look in the aspx file itself for the ListFormWebPart.
Why not do all the customizations you want on a list, save the list as a template (it will include the associated AllItems.aspx) and then use that template in your feature to create your list? You could add the extracolumn from code (if it's dynamic and cannot be included in the template), and so on.
Yes you can. Get the Sharepoint manager tool from Codeplex
http://spm.codeplex.com/
Install it on a machine in your farm, it will allow you to browse the farm via a tree view that shows all objects.
Make the list via the Sharepoint GUI, then browse to it w/ SPM.
SPM will allow you to extract the MOSS/WSS created xml that describes the list view (it shows up in the left hand property grid), which you can then plop into your manifest.xml
I have a similar issue and have been doing a lot of research into this. The dataview web part to me is one of the most powerful components in Sharepoint. Unfortunately I have to provide my solution as a .wsp package and that means that I can not just make the site and use Designer on that site. I have taken a 2 step approach in that I used designer to create my dataview and I also edited the code of that dataview to replace the ListID and Guids to ListName and the actual list name. This allows it to be exported and used in any page/site as long as the list name is the same. I am creating a webpart page document library also in my solution and I believe I can add the pages that have the webparts to this library using the onet.xml file. I will try to get the results of that test in as soon as I can do it.

Migrate the discussion list in SharePoint?

I want to migrate a Discussion List from one site collection to another site collection with all content. Is there any way to do it? We can not save the list as a template. Because we want to keep all the original information, like the Created By.
Best Regards
I suggest you take a look at the SharePoint Content Deployment Wizard (http://www.codeplex.com/SPDeploymentWizard) by Chris O'Brien. The tool uses the built-in migration API and it should allow you to move your content.
In addition to Walkdek's answer :-
Simplest way is when you create a template you have the option of including the existing content (Save List As Template > Include Content). When you move the tmplate to hte other site sollection and create a new list based on it then your data will be there.
You can also do this using SharePoint Designer - select the list, select Copy then find destination and select Paste.
Another option is Gary Lapointe's STSADM extensions such as gl-exportlist and gl-importlist

Resources