Jump to content

Sort order in admin (drag and drop)


thomas
 Share

Recommended Posts

Hello,

I noticed that when using "drag and drop" as sort order in the admin, new pages always end up on the bottom of the list.

We have a site that has a few hundred pages under one parent and i'd like to change the sort order to drag and drop so the editor can decide which article stands where on the page. The way it is now, he won't find his newly added article though, or only after going through an endless list.

Is there a way to change this behaviour so new articles go to the top of the list?

Thanks,

thomas

Link to comment
Share on other sites

You can choose sort settings for all children that use a template by going to Admin>Setup>Templates 


 

  1. Choose the template you want to edit 
  2. Click on the Family menu item
  3. Expand the "Sort setings for childen" section
  4. Choose the "Children are sorted by" option you want
  5. Toggle the direction of sort if needed
  6. Save your changes

templates-processwire.png?1360944384

  • Thanks 1
Link to comment
Share on other sites

Hello Jeff,

thanks for the detailed explanation. I was aware of that, but "reverse direction" does nothing for me when sort order (4) is on "manual drag and drop". It doesn't stay checked and it has no effect on the sort order. 

- thomas

Link to comment
Share on other sites

Sorry I misunderstood. You want both. If you set it to manual, the default will be to append.  I have not taken the time to look at the admin, but you might be able to create / modify an admin template to do what you want.  Maybe Ryan could chime in on that. 

Updated -- That behavior in the core. 

Edited by JeffS
Link to comment
Share on other sites

We don't have the option to place it automatically at the top, just because it has to renumber all the pages when you do that. That wouldn't scale for pages with huge numbers of children. Manual sorting really shouldn't be used when you are dealing with any kind of large quantities of pages. Date, alpha or some other kind of sorting is usually preferable. Manual sorting is meant for things like navigation bars. 

Link to comment
Share on other sites

Hm, this feature doesn't seem to be in version 2.2? So the sort order id "date modified" by default? And it can only be changed on a per-child basis?

Not sure that I understand. Date modified is not the default sort order. The default sort order is manual, which naturally looks like 'date created' order, until you drag a page in it to a different order. The default sort order for a page's children can be specified either at the page level or template level. If specified at the template level, you won't see the option at the page level. 

Link to comment
Share on other sites

  • 2 years later...

Old thread, I know... But I had this issue again and was wondering if it would be possible to solve this problem by somehow reversing the visual display order in the page list rather than having to renumber the sort property of each page when a new page is created. So the new pages would still get higher sort numbers, but they would appear at the top?

Link to comment
Share on other sites

I actually just tried this using the ProcessPageListMultipleSorting module. I set the sort for my parent template to -sort, and it showed the results in reverse like I wanted. New pages were added to the top.

Of course, the problem is that the page tree doesn't realize that the sort is reversed, so when I try and move one of the pages, the whole order is recalculated based on the visible order, and thus it reverses the entire list.

Anyway, I think it shows that this feature could be implemented without introducing extra overhead. It's just a matter of making the page tree javascript/php a bit 'smarter.'

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...