Skip to content

FirstChildRedirect updated for MODX 2.1 and beyond.

Notifications You must be signed in to change notification settings

olegpro/FirstChildRedirect

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

===============================================
FirstChildRedirect
Authors:
    Jason Coward <[email protected]>
    Ryan Thrash <[email protected]>
    Olivier B. Deland <[email protected]>
    Shaun McCormick <[email protected]>
    Mark Hamstra <[email protected]>
License: GPL Public Domain
Version: 2.3
===============================================
 
This snippet redirects to the first child document of a folder in which this
snippet is included within the content (e.g. [[FirstChildRedirect]]).  This
allows MODx folders to emulate the behavior of real folders since MODx
usually treats folders as actual documents with their own content.

Added parameters to allow greater flexibility

&docid=`12` (optional; default: current document)
Use the docid parameter to have this snippet redirect to the
first child document of the specified document.

&default=`1` or &default=`site_start` (optional; default: site_start)
Use the default parameter to have this snippet redirect to the
document specified in cases where there is no children.
It can be a document ID or one of : site_start,site_unavailable_page,error_page,unauthorized_page

&sortBy=`menuindex` (optional; default:menuindex)
Get the first child depending on this sort order
Can be any valid modx document field name

&sortDir=`DESC` (optional; default:ASC)
Sort `ASC` for ascendant or `DESC` for descendant 

About

FirstChildRedirect updated for MODX 2.1 and beyond.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%