PageTreeAddNewChildsReverse by horst

New Pages in Descending Sortorder (newest first) while sortmode is Manual Drag-n-Drop

Pagetree Add New Childs Reverse

ProcessWire Admin: New Pages in Descending Sortorder (newest first) while sortmode can be "Manual Drag-n-Drop"

When a site display an overview of the latest posts, news, image-albums, etc. the newest entries should be on top of the list. We can achieve that by using an automated setting for the sortfield e.g. when the page was created = "-created".

But this way we are not able to manually move a single page in the tree.

This module enables us to do exactly that. It works with manually created pages, with pages created via the API, also when bootstrapped by importer scripts.

====================

Pagetree "Newsitems" with 3 newsitems sorted in descending order.

alt text

===

New created item 4 is added to the top.

alt text

===

To change the order click item 3 and drag it to the top and drop it.

alt text

alt text

alt text

How to use it

Download the module into your site/modules/ directory and install it. In the config page you find a single textarea field. Here you can enter the templatename or page-ID of the parent which children should get reverse added, - optionaly followed by a colon and the child-templatename if you need a more precise selector. You can add as many parents as you like, but only one on each line and in this format: TEMPLATE-NAME or PAGE-ID[,CHILDTEMPLATE-NAME].

A few examples:

newsitems
posts,post
1042
1033,album

You want set your template(s) sortfield(s) to 'Manual drag-n-drop' if not have done allready.

ATTENTION

You need to setup the TreeParent and the module config when there are no children in it! Otherwise it will not work!

Also disabling the module once you have added childs and then add one new pages to it will mess up all! (You may think about to install the module as permanent in critical situations.?! see below ->)

Per default you are limited to 1.000.000.000 childpages, but you may increase it if you need :)

ProcessWire forums thread of this module

Install and use modules at your own risk. Always have a site and database backup before installing new modules.

Twitter updates

  • ProcessWire 3.0.171 dev branch core updates – More
    22 January 2021
  • Preliminary 2021 roadmap in progress in this week’s update— More
    8 January 2021
  • Happy New Year! Today I’ve bumped the version on the dev branch to 3.0.170, and it’s quite a lot of updates. This post covers most of them. In this post, there’s also a question for you: what would you like to see in ProcessWire in 2021? More
    1 January 2021

Latest news

  • ProcessWire Weekly #349
    In the 349th issue of ProcessWire Weekly we're going to cover the latest core and forum updates, introduce some recent ProcessWire resources, and more. Read on!
    Weekly.pw / 16 January 2021
  • ProcessWire 3.0.170 core updates
    Happy New Year! Today I’ve bumped the version on the dev branch to 3.0.170, and it’s quite a lot of updates. This post covers most of them. In this post, there’s also a question for you: what would you like to see in ProcessWire in 2021?
    Blog / 1 January 2021
  • Subscribe to weekly ProcessWire news

“We were really happy to build our new portfolio website on ProcessWire! We wanted something that gave us plenty of control on the back-end, without any bloat on the front end - just a nice, easy to access API for all our content that left us free to design and build however we liked.” —Castus, web design agency in Sheffield, UK