1

When navigating to Settings > Site Contents you see a page, alphabetically displaying the lists, libraries and apps of that site.

Is it possible to group/organize these into logical groups? I cant find anything useful online. :(

2
  • It is organized by display name of the list/library, disorganized implies some random order which isn't the case. May 13, 2016 at 18:36
  • Thanks - was aware but have edited to signify alphabetical sort order.
    – Levi
    May 13, 2016 at 18:45

2 Answers 2

2

I don't think there is way to re-order the site contents as of now. But wait for the May 4 announced changes roll out to your tenancy, the new site contents page allows you to sort based on Name, type, number of items and Modified.

enter image description here

0
  1. create custom property for each list/library:

    A) add applicationPage with radio buttons like this: enter image description here

    code behinde:

    get all groups

    protected void Page_Load(object sender, EventArgs e)
    {
      //fill ddl 
      SPList currentList = Web.Lists.GetList(new Guid(Request.QueryString.Get["list"],true));
      string currentGroup = null;
      if(!currentList.Hidden) //lists in siteContent
      {
         List<string> groups = new List<string>();
         foreach(SPList list in  Web.Lists.OfType<SPList>().Where(a=> !a.Hidden))
         {
            string myGroup =    list.RootFolder.Properties["customGroup"].ToString();
            if(!groups.Contains(myGroup) )
            {
               groups.Add(myGroup)
               if(currentList.ID == list.ID)
                  currentGroup = myGroup;
            }
        }
     }
     ddl.DataSource = groups;
     ddl.DataBind();
    
     //set checked input new/exist
     ListItem item = ddl.Items.FindByValue(currentGroup )
     if(item == null)
        ddl.Value = currentGroup;
     else inputNewGroup.Checked = true;
    }
    

    save group

    protected void ok_click(object sender, EventArgs e)
    {
       string currentGroup = null;
       if(inputNewGroup.Checked)
          currentGroup = txtNewGroup.Text;
       if(inputExistingGroup.Checked)
          currentGroup = ddl.Value;
       SPList currentList = Web.Lists.GetList(new Guid(Request.QueryString.Get["list"],true));       
      currentList.RootFolder.Properties["customGroup"] = currentGroup 
      currentList.Update();
    }
    

    B) call page you created by customAction

    <CustomAction Id="CustomAction" Title="Group" Sequence="0" Location="Microsoft.SahrePoint.ListEdit" GroupID="GeneralSettings">
      <UrlAction Url="~sitecollection/_layouts/15/ChangeMyGroupList.aspx?List={ListId}" />
    </CustomAction>
    

now the list settings page look like this: enter image description here

2. display lists group by categories:

change the /_layouts/15/viewlsts.aspx (or copy and change the link in masterPage)

open the file from c:\program files\common files\microsoft shared\web server extensions\15\template\layouts

add code:

  • replace foreach(... in rgApps), to

    string currentListgroup= null;
    string group = null;
    bool isNewGroup = false;
    foreach(KeyValuuPair<string,object> entry in 
    (from list in rgApps
     order by (list.Value as SPList).Title
     order by (list.Value as SPList).RootFolder.Properties["customGroup"]
     order by (list.Value as SPList).RootFolder.Properties.ContainsKey("customGroup")
     select list))
    

    in the foreach block insert code:

    if(entry.Value is SPList)
    {
       SPList list = (SPList)(entry.Value)
       currentListgroup = list.RootFolder.Properties["customGroup"].ToString();
       isNewGroup = currentListgroup != group ;
       group = currentListgroup ;
    }
    
  • before the div with id="apptitle-<%SPHttpUtility.WriteHtmlEncde(id...)%>" insert new element

     <% if(isNewGroup )
    { %>
      <div class="group">
         <h2 class="ms-vl-sectionHeaderRow"><%= group%> </h2>
      </div>
    <% } %>
    

now site content look like this:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.