tags:

views:

3848

answers:

5

Is it possible to create sub lists in sharepoint? I am currently using folders to organise my content but folders are a totally different concept in sharepoint when accessing them programactically.

I want to achieve something like:
-web
----List A
---------Sub List 1
---------Sub List 2
----List B
---------Sub List 1
---------Sub List 2

EDIT 1:

I am trying have a sortable list directly below the web. Currently iam achieving this by creating a custom folder with a custom SortOrder Column and a Title. The folders Title ultimately will become the Section Title on the public site and the items within each folder will be the content underneath the section. Is there a better way to do something wich seem fairly trivial?

Thanks for your help

Edit 2 (response to jason):

Well we'd like to keep the content organised. Say we have a corporate leadership list. Within this list we have the Chairman, CEO, Directors folders. Then with each of these folders are the items (people). Is there a better way to organise this?

A: 

there is no notion of a sub-list in SharePoint. You may be able to achieve the desired effect by using Lookup fields.

can you tell us a little bit more about what you are trying to accomplish?

Why do you need sub-lists at all? Why not have separate lists for each content area you want to display on the public site?


Updated:

There are a coupld of different approaches I can think of:

  1. Add a choice field to the list that categorizes each of the people. You will be able to create views to filter the items in the list, and create CAML queries for programmatically selecting the items you are interested in. You should be able to easily segment the list for displaying on the public page.

  2. If these are job titles, they could be stored in AD and brought into SharePoint via the profile import functionality. You could then develop web part (one may already exist), to show users with specific profile properties (in this case 'Title')

Jason
please see my edited question above.
Jason's right, the best way is to use a 'choice' column on the list to specify the category, then filter based on this. For MD, CEO, etc. you could allow the column to be blank, or use CAML to not display the value entered.
Calrion
+2  A: 

Specifically, no. You can't have nested lists in SharePoint.

However, there are a number of ways that you can get something that to end users is pretty similar. There are two options:

The first option is grouping. Include a column that you want to group by (e.g. for a list containing city names, you might want to group by state or country--or both), then setup a view to group by that (or those) columns.

The second way is to use two separate lists within the same site (must be same site) and link one to the other using a lookup column type (e.g. you create one list to hold a list of countries, one list to hold a list of states, and a third list to hold a list of cities that includes lookup columns for state and country). You can only have one level of lookup, so you can't, for example, have a lookup column for country on the state list and then link the state list to the city list AND display the country the city is in; you can display the state just fine (and if you create a calculated column on the state list to show "State, Country", then you can display the result in the city list) but that's all.

Calrion
not entirely accurate Lookup fields can cross site boundaries if you are managing them programmaticaly which the OP specifically said he is.
Jason
A: 

Quick correction on the lookups. The lists don't have to be the same site, but just the same site collection. If they are in different sites you have to do some extra work. I believe you just need to use a site column for the lookup field, but I'm going from memory and there may be another step involved.

Kirk Liemohn
A: 

I think the real issue is hindering on "sub-lists". If it is a "lists in s list", then I think it is inaccessible. At least in the best of my knowledge.

If you are just want link two lists in different sites or folders whatever, as long as they are under same site collection, it can be done. (If I light-read read your post,then sorry! pause your reading!) There are couple of approaches:

  1. Take a look at t his post http://blah.winsmarts.com/2007-10-Performing_joins_between_SharePoint_lists.aspx
  2. Tools like Sharepoint List Collection or Sharepoint Cascaded Lookup may be your ideal way. The trouble is most of them are operated through data view.

Hope it helps PS. It is a good question!

+1  A: 

SharePoint 2007 has no inherit List-in-List support, however...

You can have multiple Sites (really Webs) in a given Site Collection in SP2007 and Sites (really Webs) can have sub-Sites (really child Webs). This can used to simulate the above "List-in-List". The approach may not be ideal, but isn't too hard to work with for some tasks if all the Sites (really Webs) are in the same Site Collection (don't confuse with Site). In this case the following would be:

-Site Collection
----Web A
---------Sub List 1
---------Sub List 2
---------Web C (why not?)
----Web B
---------Sub List 1
---------Sub List 2
pst