This is an auto-generated topic for <a href="extras/package/?151full">FirstChildRedirect 2.2-pl</a> by splittingred.
Brief Description:
Redirect the page to the first child element.
Hi,
Maybe the documentation can be updated by writing the fact the &sortDir=`RAND()` works.
Thanks
Hi!
I’m using the 2.0.0-pl version and FirstChildRedirect does not work if using menuindex as sort order. It always takes the first document based on ID.
Daniele "MadMage" Calisi
-
☆ A M B ☆
- 3,112 Posts
The &sortDir is set as ASC by default
<?php
/* sort dir */
$sortDir = isset( $sortDir ) && $sortDir == 'DESC' ? $sortDir : 'ASC';
Unfortunately, getResources also uses &sortDir parameter which is set as DESC by default.
[[!FirstChildRedirect? &sortDir=`ASC`]]
will override the weird behavior.
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.
I don’t think the getResources default value should affect it, but I haven’t tested that.
Be sure to call the snippet uncached:
Quote from: tkfm at Sep 27, 2010, 02:22 AM
No. The default value of sortBy parameter is "DESC".
See the default property of FirstChildRedirect snippet.
Sorry, you are correct. Thanks for catching that.
I think it should be updated as &sortDir=`ASC` in the default propertyset.