none
SharePoint 2007 - How to configure different RootFolders for lists added to a page as web parts

    Question

  • For example:

    I have a page (http://examplesite/Pages/MyTeamPage.aspx) with two lists added as web parts.

    1.Invoices
    2.Tasks

    I want to show different folders of each list.

    Invoices - /Lists/Invoice/2012
    Tasks - /Lists/Tasks/RedTeam

    When I specify the RootFolder as a querystring I observe following behaviour

    http://examplesite/Pages/MyTeamPage.aspx?RootFolder=/Lists/Invoices/2012

    1.It shows only the content in folder 2012 in Invoices list
    2.It shows all content in all folders in Tasks list including folders

    http://examplesite/Pages/MyTeamPage.aspx?RootFolder=/Lists/Tasks/RedTeam

    1.It shows only the content in folder RedTeam in Tasks list
    2.It shows all content in all folders in Invoices list including folders

    What I want to do is to have the MyTeamPage.aspx to show;

    1.Only the content in folder 2012 in Invoices list
    2.Only the content in folder RedTeam in Tasks list

    How can this be achieved? 
    Tuesday, December 04, 2012 11:42 PM

Answers

  • I'm really sorry. I just realized that there was a typo in my last reply, which I just edited now. You can't specify 2 different values for a query string parameter. You might wan to unmark the last post as the answer.

    For granular security like that, yes you need folders. What if you combine them both? It's probably not the best solution; perhaps you can test it out and see if it helps.

    Keep folder structure as is with security permission, but also use meta data column. Then you can create separate views based on the meta data info/columns and set the Folder setting to Off so that all data is displayed without folders. This way, you can have filtered view of certain info only and it'll also take care of security. If there's an item from certain folder that the user doesn't have access to, it won't be available to them in the view. At least that's what I'm expecting.

    I hope that made sense...


    Pman
    http://www.pmansLab.com/

    Thursday, December 06, 2012 1:55 AM

All replies

  • I think what you're getting is expected. The value of the "RootFolder" applies only to one of those list/library and you can't specify two different value for that query string parameter.

    I very rarely recommend using folders in lists/libraries. I'd suggest you use meta data. Add columns to your task list and the library. That way you can create different views to filter out the data you need and then only show those data in your page. 


    Pman
    http://www.pmansLab.com/


    • Marked as answer by Nadeeja Bomiriya Wednesday, December 05, 2012 6:39 AM
    • Edited by Parvez Akkas Thursday, December 06, 2012 1:45 AM Edit: correct a typo
    • Unmarked as answer by Nadeeja Bomiriya Thursday, December 06, 2012 2:20 AM
    Wednesday, December 05, 2012 3:57 AM
  • Thank you very much for your reply Parvez.  Good to know that you can specify two different values for a query string parameter.  Should the values be comma separated?

    Adding folders to list is client's specific requirement. The reason to use folders is that it's easier to apply security to folders.  Only certain users are allowed to access list items inside each folder.  I agree that using meta data is a better idea, if not for the security requirements.

    Would you recommend a better way to apply security to a group of list items within a list (without using folders)?  Or is there any other way to achieve the same result without using RootFolder query string?

    Thank you for your help.

    Wednesday, December 05, 2012 4:30 AM
  • I'm really sorry. I just realized that there was a typo in my last reply, which I just edited now. You can't specify 2 different values for a query string parameter. You might wan to unmark the last post as the answer.

    For granular security like that, yes you need folders. What if you combine them both? It's probably not the best solution; perhaps you can test it out and see if it helps.

    Keep folder structure as is with security permission, but also use meta data column. Then you can create separate views based on the meta data info/columns and set the Folder setting to Off so that all data is displayed without folders. This way, you can have filtered view of certain info only and it'll also take care of security. If there's an item from certain folder that the user doesn't have access to, it won't be available to them in the view. At least that's what I'm expecting.

    I hope that made sense...


    Pman
    http://www.pmansLab.com/

    Thursday, December 06, 2012 1:55 AM
  • Thanks Parvez.  I'll try this out.
    Thursday, December 06, 2012 2:28 AM
  • Hi Parvez.  Your suggestion works well.  Thanks.  The reason I wanted to use RootFolder was, when I create a new item, it gets created inside the specified folder.  Without it the item gets created in root.  To get the same effect without using RootFolder, I used ItemAdding and ItemAdded events to copy the Item to the specified folder (folder name is extracted from query string) and deleted the originally created item.

    Thank you for your help.

    Thursday, December 06, 2012 10:25 PM
  • Glad that worked out for you.


    Pman
    http://www.pmansLab.com/

    Friday, December 07, 2012 1:49 AM