问题
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?
回答1:
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.
回答2:
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
回答3:
Here's an example where a sublist is needed (my issue :)). I am collecting textbook information for various courses in our department. I really only need the course info once and then the info for each book associated with that course:
GER 555, Textbook Title, POC (instructor) info, etc textbook title, ISBN, VER, Author etc textbook title, ISBN, VER, Author etc textbook title, ISBN, VER, Author etc
Some courses have as many as 8 books and is a pain for the instuctor to have to fill out a form every time.
回答4:
You can't have sublists in SharePoint but if all of your lists are going to have the same metadata you can sure as heck have folders in document libraries. All a document library is is a list that is made to house documents. You can put subfolders in it and all of that.
That being said, I think a lot of the pushback you're seeing here is that this idea of "sublists" doesn't really get at the real power of SharePoint, which is that you're using a relational database like SQL. Ideally, you shouldn't think of "sublists", per se. What you really ought to be thinking about, I think, is different views of a list, which in and of itself is more or less a database table. Just filter out the items you want and don't want in each particular view and as far as the end users are concerned, all they see is their own data. You can then programmatically access those views simply by calling them.
SPView view = yourList.Views["View Name"];
SPListItemCollection items = list.GetItems(view);
回答5:
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:
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.
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')
回答6:
I have managed to create document sets (SharePoint 2010) in a custom list. It was a bit accidental and I'm not sure if it is wise to do this (happy to take advice).
I wanted to partition a list by "Organisation" and I wanted to have a Minutes Document Set for each Organisation, containing the Minutes for each respective Organisation. The steps I used:
- Created content type for Minutes based on list item
- Created content type for Minutes Document Set based on Document Set
- Created custom list for Minutes
- Added both Minutes and Minutes Document Set as content types
- Removed Document as a content type for the list
Now I can create Minutes Document Sets in the list and add Minutes list items to those document sets - the proviso is that I'm creating the document sets using PowerShell as when I try to do it using the browser, SharePoint tells me I cannot (which is weird because at one point I did in fact create a document set using the browser but somewhere along the way this stopped working).
When accessing a document it will not display the Document Set view. That view is specifically for libraries and SharePoint will complain if you try to use it to display the contents of a Document Set in a list.
As I mentioned above, this was something of an accident that occurred because I wasn't aware that you weren't supposed to be able to do this. Use at your own risk.
回答7:
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:
- Take a look at t this post.
- 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!
来源:https://stackoverflow.com/questions/645378/how-to-create-sub-lists-in-sharepoint