Use FirstChildRedirect to redirect users to the first document in a folder (based on menuindex sort order, however configurable) when they access a folder document within MODX.If no children are found for the specified document, FirstChildRedirect will redirect users to the site start page, though this behavior can easily be modified by passing &default to the snippet with either a page ID, or one of the following: site_start,site_unavailable_page,error_page,unauthorized_page.
You can also use the &sortBy (any resource field) or &sortDir (asc or desc) parameters to specify what to sort on. Please note that it always takes the first resource.
Documented at http://rtfm.modx.com/display/ADDON/FirstChildRedirect, and source kept on Github at https://github.com/Mark-H/FirstChildRedirect
February 7, 2020
MySQL, SQL Server
2.5 - Current
Install via Package Management.
New in 2.4.0-pl
- Simplify internal logic for response code shortcuts
- Code style reformat, now requiring at least PHP 5.4 (but really, use 7.1+)
- Confirmed compatibility with MODX3 alpha2+