One thing that has always confounded me is the lack of a breadcrumb in List View WebParts.
Picture the scenario, You drag a Document library list view onto your web part page. fine no problems there. You click on the first folder, down one level, then another, Then perhaps one more.. Hang on, I thought folder structures should be a thing of the past? Ah well, the document I want isn’t here, I’ll go back up a level.. (I should have used searched shouldn’t I?).
Hang on.. how do I get out of here.. help.. let me go back up a level..I can’t.. I’m stuck!!!!!!!!!! Waaaaahh.. Page reload.. ah I’m back at the top, all calm again…
So how do we get around this problem? Well in the first instance, lets avoid the use of folders where possible, but in some implementations, it’s just not possible, afterall, users are familiar with the concepts of folders and hierarchical structure.
This was the problem set to me by a client recently and solving it is a quite interesting problem that I’m part way through solving.
So I have two approaches, the first one is brought about by the realisation that when you place the list view on a publishing page, and drop down a folder level, a querystring is placed into the URL that shows the current folder location. Fine, we can probably parse that out and use the locations to create a breacrumb, but for some reason it doesn’t root itself in the library itself, but the parent of the website itself.
E.g. http://website/sub-web/Forms/Forms Library/First folder with the querystring showing /sub-web/Forms/forms Library/First Folder (Note: Both sub-web and forms are websites within a publishing collection.)
So not perfect, Also, what happens if we have mroe than one list view web part on the page? (I’ve not investigated that one yet..)
The second option is to get a connection into the Page WebPart manager and see if we can find out any information on the current folder from the List View Web part itself.. The jury is out on this one..
So watch this space for some code very soon..
Reg.