AnsweredAssumed Answered

Sort Site Members by Surname not name on site dashboard

Question asked by 4535992 on Sep 12, 2017
Latest reply on Sep 14, 2017 by 4535992

Hi i want to order member of the site on the site dashboard by the surname/name instead of the name/surname like set by default from alfresco.

i found  the script site-members.js to customize for sort by surname instead name, i just change the default code:

 // Sort the member list by name
    items.sort(function (membership1, membership2)
    {
      var name1 = membership1.firstName + membership1.lastName,
         name2 = membership2.firstName + membership2.lastName;
      return (name1 > name2) ? 1 : (name1 < name2) ? -1 : 0;
    });

....................................................................

  if ((firstName !== undefined) || (lastName !== undefined))
         {
            name = firstName ? firstName + " " : "";
            name += lastName ? lastName : "";
         }

............................................................................


 with this:


    // Sort the member list by surname

items.sort(function (membership1, membership2)
    {
      var name1 = membership1.lastName + membership1.firstName,
         name2 = membership2.lastName + membership2.firstName;
      
      return (name1 > name2) ? 1 : (name1 < name2) ? -1 : 0;
    });

.....................................................................

if ((firstName !== undefined) || (lastName !== undefined))
         {
            name = lastName ? lastName + " ": "";
            name += firstName ? firstName : "";        
         }

...............................................................

 

it's work when i go to the dashlet "All Members" of the site but it's not work for the "preview" in the site dashboard, there is some other javascript i need to modify? here i put a image of the problem:

They are still order for name not surname. Someone can help me with that.

Outcomes