Dear garryn,
You suggestion worked. Thanks a bunch.
This is what I have in my checkDocID snippet. Is there a better way to do it?
$snippetName= 'NewsListing';
$snippetParams=array('summarize'=>4,
'multilevel'=>1,
'truncText'=>"Read More",
'hidefolders'=>"true",
'truncSplit'=>"false",
'tpl'=>"ch-listing",
'dateformat'=>"%d,%b,%Y",
'showarch'=>"false",
'archplaceholder'=>1,
'emptytext'=>"No content available");
if($modx->documentObject['id'] == 1){
$docID="5,12,13";
$snippetParams['startID'] = $docID;
$outstring=$modx->runSnippet($snippetName, $snippetParams);
return $outstring;
}
if($modx->documentObject['id'] != 1){
$docID=$modx->documentObject['id'];
$snippetParams['startID'] = $docID;
$outstring=$modx->runSnippet($snippetName, $snippetParams);
return $outstring;
}
There is one small issue, though... when the folder DOES NOT contain any documents "NewsListing" should return the value of the "&emptytext", but instead it retuns an ERROR, shown below...
ERROR
====
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« PHP Parse Error »
PHP error debug
Error: array_values() [function.array-values]: The argument should be an array
Error type/ Nr.: Warning - 2
File: E:\xampp1.5.1\xampp\htdocs\ngo\manager\includes\document.parser.class.inc.php(691) : eval()’d code
Line: 418
Any, idea why is this happening.
warm regards,
-Raavi