Last time we looked at the problem of referencing lists and libraries directly on a public facing web site after adding a link to the Quick Access menu when creating the list or library. However, that is not the only way you can get into trouble.
On a public facing site, it is possible to display the contents of a list or library by displaying a view of the library or list. To do this, all you need to do is open an existing page or create a new page, select a web part zone where you want to display the list or library and click Add a Web Part.
The Insert ribbon that appears includes a panel beneath the ribbon that shows the web parts by category. You can add any of these web parts to the zone.
In the first column of this panel (named Categories) select the Lists and Libraries category. This displays a list in the column Web Parts to the immediate right that shows all lists and libraries in the current site. This section supports two columns of eight items each. If you have more than sixteen lists and/or libraries in the site, navigation arrows at the bottom of this section (greyed out in the above image0 allow you to scroll right and left to view additional groups of up to 8 lists or libraries with each click. Let’s assume that I want to display the Documents library. I need only select it so it is highlighted and then click the Add button in the lower right corner. As you can see, this adds a view of the library to the page.
Once the page has been published (assuming you have publishing turned on for your public facing sites), an anonymous user might open the page, see a Microsoft Word document, as shown above, and attempt to click on it. As an anonymous user, they do not have rights to edit a document. If the library is set up to download the document to the client, SharePoint displays a security dialog such as the one in the next image prompting the user to log in before it allows the document to be downloaded.
But anonymous users do not have user names and passwords. Therefore, all they can do is cancel the action. One solution might be to also upload a PDF version of the document. This is relatively easy since all Microsoft Office applications can output a PDF version of their documents.
Even with a PDF, SharePoint needs to download that PDF to the client. But since a PDF is not considered to be editable, there is no security warning. Instead, it considers a PDF to be an executable file. Therefore, the user gets a dialog warning them that some files could harm their computer when they are executed.
Of course, if you go this route, you may want to clean up the library display to use a view that filters on only the PDF files in the library. However, even if you do that, there is still an issue with the dropdown menu associated with the item.
Clicking on the menu dropdown as an anonymous user also opens a Windows Security dialog:
So what can you do to display items in a document library that people can open? One method that I have found effective is to use the Content Query Web Part to display the items from a library. Using this web part, you can filter (such as on PDF files) and sort on one or more columns to create a list of links to your documents. But even this method could still prompt you with the message that you are downloading a potentially harmful file to your local computer.
One solution we implement to solve this problem was to install Microsoft Office Web Apps on our SharePoint servers. Then we would open the library, open the Library ribbon, and click on Library Settings. On the Library Settings page under the General Settings group, click on Advanced Settings.
Then in the Library Settings, we turned on Use the Server Default which is to open in the browser (we could also use Open in the Browser). This will force Office Web Apps to try to open the document, even Microsoft Word documents can be directly opened this way without prompting the user for a username and password. PDF files will also open in the browser without a warning about the file potentially harming your computer.
To display a list, we found a slightly different solution. The problem with lists is both one of clicking on the title (default) column of the displayed list and clicking on the dropdown menu associated with the title. However, the list problem can be solved most elegantly by simply changing the columns displayed in the list view. By default, many people select the Title column (renamed in the image below as OpenLabID) to appear in the list. Note that in parenthesis that this column is linked to the item with an edit menu.
Simply replace this column with another version of the column named Title (or OpenLabID in this example) that does not link to the edit menu.
Now when you display the list to users who do not have edit rights, the viewers can see the data without having to worry about whether they have rights or not.
Hope this gets you through a few problems.
C’ya next time.