EndUserSharePoint.com: How can I display a source library in multiple sites?
The question of the day comes from Fredric in Sweden:
I have one library with a lot of documents regarding different companies. I want them all in the same folder. I also want to display the content under a site called Customers where I can have one document library for each company. From what I’ve seen the CQWP can only show the topics of the documents, or whatever chosen to show. What I would really want is a document library where I can gather information from the whole site, based on a string in some column or so.
Fredric – First, congratulations on getting your initial library setup and flattened to contain all customers. This is the first steup needed in order to make your information accessible and manageable.
My first suggestion is to rethink your architecture a little. Do you really need a document library for each company or do you just need to expose each company’s data as an individual set? Your source library is setup. There is no need to duplicate that.
If you would create a new page for each company and expose its documents that way, it would seem to make more sense to me. The quick outline is to create your source library with all the company documents (you already have that), create a web part page for each company on the other sites you have created and use the CQWP (Content Query Web Part) to filter for each company.
Because you are trying to access documents across multiple sites, you will need to use the CQWP and the filter options to select the documents you need. As an example, if you have a column called Company, use that column for filtering the content for each company.
The caveat to this is that the company column must be a site column that is available to all sites. If it is not, that column will not be available to use as a filter on other sites.
Steps for implementing the solution
- Move to the top of your site structure
- Create a site column called Company
- Insert the names of the companies into that site column using either the Choose data type or a Lookup data type
- Use the newly created site column when creating your source library
- Move to the other sites where you want to expose the company information
- Insert a CQWP
- Filter the web part by the company column
Using this technique, you now have a robust solution that does away with the overhead of maintaining multiple libraries.
Regards,
Mark
That’s a great solution. How could I take that a step further and limit the searchs so that only certain people can see only certain companies?
Ben,
The SharePoint search only shows those results that the logged users can access. If you have all docs in a document library you will have to break de permissions inheritance and assign permissions individually to each document.
Hi Ben,
[..]The caveat to this is that the company column must be a site column that is available to all sites.[..]
If there is new company and needs some additional colums but they are not needed for the other companies. is it possible to have one or more create pages in one library?
Kind regards,
John
John – Yes, this is done by managing Content Types. This is worth a post in itself, but the idea is that a library can contain multiple Content Types. The selection of the content type is exposed through the dropdown, Create, menu on the library menu bar.
Short list:
Create the content type
Create an optional template to associate with the content type
Attach the content type to the selected library
As I said, this is worth a tutorial post which I’ll try to get to in the next week.
Regards,
Mark
Thanks for your fast reply. Is it true that this isn’t working for a Wiki library?
The problem is that I want to have several pages, customers,applications and server. For all these types I want to have different create page templates because a server wiki site has nothing to do with customer information (address,phone numbers…)
Kind regards,
Jorn
John – You are correct. Wikis OOTB do not allow management of content types. If you can explain exactly what you are trying to do, maybe we can come up with a solution together.
Mark
Hi Ben,
We want to have all the information about Customers, Servers and applications on our wiki. So when creating a new page only the fields (collums) that are nescecary for a server hase to be filled in. This is possible because they are not required fields but all the other fields will also show when I view this new page. We want also to links to servers and applications on a customer page ( like [[Word 2007]],[[Excel 2007]] ) but these links hase to be in the same wiki library or these links would not work. A technical engineer only wants to fill in a few text fields when adding a page but when he goes to the new page al the fields are showing up. In our situation this would be about 20 empty fields and 5 filled in fields on one page. We also want to create some views where we filter information like: Only show the applications for CustomerA or show only the servers for CustomerB.
Kind Regards,
John
Another thing to consider with using the CQWP for this type of solution – if you want to add custom columns and filter by those columns, you will need to configure the CQWP to see those columns, which means modifying the XML associated with the CQWP and then uploading your customized CQWP to get this to work.
Two excellent posts on how to do this are:
Microsoft’s Blog:
http://blogs.msdn.com/ecm/archive/2006/10/25/configuring-and-customizing-the-content-query-web-part.aspx
Heather Solomon’s blog:
http://www.heathersolomon.com/blog/articles/CustomItemStyle.aspx
Ben – Thanks for two nice resources on the CQWP. I was going to write something up, but now I might just screencast one of those examples.
Mark
Does this solution still hold up if the multiple sites are in different site collections?
James – OOTB, no it does not. There are third party web parts that will allow you to make informtion visible across site collections, however. I know that Box Mixon (http://www.bobmixon.com) is working on one that should be available soon.
Regards,
Mark
Other than the solution that Bob is working on, can you name any of the 3rd party web parts you are aware of?
Thanks!
James – CorasWorks has one and QuestSoftware has one. I have not used either, but their literature says the cross site collection web parts are available.
Regards,
Mark
I can’t add the CQWP. It isn’t in the list of webparts. hase this something to do with my MOSS2007 configuration or is this some kind of feature?
Kind Regards,
John
Solved.
Had to activate these features on the site collection.
Office SharePoint Server Publishing Infrastructure
Office SharePoint Server Search Web Parts
Regards,
John
Think I have a good workaround now. Created one Wiki Library. Added a dropdownbox column: What kind of wiki page. Options: General, Server, Applications, network. After that I created some list pages and added the content query part. And added an filter for type of page = Server. Now we can order these pages in categories.
Is it possible to add default wiki content when creating a new page? So there is allready some text in the wiki field.
Kind regards,
John
John – You can rewrite the template for the wiki, but that won’t be OOTB. What I have done is created a hand coded HTML table and stored it in a text file on my harddrive. Whenever I build a new wiki page, I paste the HTML into the Source of the wiki page, revert back to Rich Text and edit the content from there.
One of the problems with the format of the OOTB wiki is that the content spreads across the entire page. By using an HTML table template, I can limit the width to 700 pixel and include a consistent footer menu at the bottom of each page.
Is the CQWP only available with MOSS?
Chris – CQWP is part of the publishing feature in MOSS. If you are running basic WSS, you are out of luck. – Mark
Chris – if you are really forced to use WSS, and are willing to hack a bit, you can use SharePoint Designer to create custom views.
Open the default.aspx page in SharePoint Designer, and use Insert->SharePoint Controls->Data View. Then follow the prompts to create an appropriate Data Source. You just need to point to the appropriate source library.
You can tweak out the View, by setting Filters, adjusting the Sort Order, and picking which fields to show. If you know XSL you can have lots of fun by editing the raw page source.
This type of customization is a dangerous road to go down. You are editing the .aspx page, and your edits will probably not survive future upgrades to the next major SharePoint version. But, if you need to bang out something quick, consider getting your hands dirty in SP Designer.
Is it possible to do this for a Knowledge Base as well?
I’ve had no luck displaying a list of recent KB articles/documents (portal/SiteA/KB) on another site (portal/SiteA).
How can I display in a webpart, a list of files inside a folder in a Document Library?
Thanks