-
☆ A M B ☆
- 24,524 Posts
$children= $modx->getActiveChildren($docid, 'menuindex', 'ASC');
It uses menuindex to determine the first child, so the resource with the lowest menuindex would be the "first" child.
-
☆ A M B ☆
- 24,524 Posts
Ah, I posted the code from the Evo version. The Revo version may be doing something else altogether.
I downloaded FirstChildRedirect snippet (Version 2.2-pl) and checked the code.
It looks like &sortDir parameter is set to "DESC" in its default property settings.
So you can override the default value by specifying &sortDir=`ASC` in the snippet call.
Thinking of the name of this snippet, the default value should be "ASC"...
Thanks for posting this, it was driving me nuts.
Crawford Paul
Bridgecourt Web Design - Proudly using ModX CMS
Serving Welland, Niagara, Ontario, Canada and the world!
http://www.bridgecourt.com
The reason this was happening is that in the Property Set sortDir was set to the default of DESC.
So the code says the default is ASC, but the Property Set says DESC - the property set takes precedence.
You can find the Property Set for this Snippet in the "Properties" tab of the snippet.
This bug persists. I can’t find a place to report the bug. Shall we rename this LastChildRedirect?
Revo 2.0.8-pl