Sunday, July 19, 2009

List Definition with no search results

Scenario:
Once in a while we need some hidden list to store some information which we programtically want to consume without letting end users know about it.

Another important thing is that search should not display anything from this list.

Solution:
List Definition does support a tag Privatelist to do similar to this.

Example:

<List 
Name="Private Documents"
Title="Private Documents"
Description="This library store some internal documents used with in the site."
PrivateList="TRUE"
Direction="0"
BaseType="1"
Url="PrivateDocuments"
DisableAttachments="TRUE"
Type="101"
Id="NewGUID"
xmlns="http://schemas.microsoft.com/sharepoint/">
.....
</List>
Note:
Earlier in this ( post ) I already showed you how to create an instance of any list with NoCrawl=True , making that particular instance of the list hidden from search results. Above example is different in the sense , that here list definition itself is hidden and so will be all the instances created from this list definition.

0 comments: