2013-06-17 2 views
0

getResources를 사용하여 문서 및 해당 하위 문서의 내용을 가져 오려고합니다. 이 작업을 수행하려면 &depth을 사용할 수 있다고 생각하지만 제대로 작동하지 않는 것 같습니다.ModX : 문서 및 문서 하위의 getResources

echo "[[!getResources? $parents=`15` &includeTVs=`1` &resources=`" . $resid . "` &depth=`1` &tpl=`tendertmp`]]"; 

과 : - 첫 번째 예는 깊이없이 잘 작동

echo "[[!getResources? $parents=`" . $resid . "` &depth=`1` &includeTVs=`1` &tpl=`tendertmp`]]"; 

$resid이 조각에 의해 생성 된 단지 숫자입니다

나는이 방법을 시도했습니다.

깊이를 사용하는 올바른 방법이나 리소스 리소스 콘텐츠와 함께 reources 콘텐츠를 가져 오는 방법을 아는 사람이 있습니까?

답변

4

http://rtfm.modx.com/display/revolution20/modX.runSnippet을 사용하지 않는 이유는 무엇입니까?

$output = $modx->runSnippet('getResources',array(
    'parents' => $resid, 
    'depth' => '1', 
    'includeTVs' => '1', 
    'tpl' => 'tendertmp' 
)); 
echo $output; 

$parents 대신 &parents에서 두 번째 실수.

0

PHP 스 니펫에서 getResources를 실행하려고하는 이유를 실제로 이해하지 못합니다. 그렇게 할 이유가 거의 없습니다.

당신은 당신의 페이지에서 직접 $modx->getCollection('modResource, $someCriteriaHere); 또는

통화의 GetResources 간단하게 할 수있는 :

[[!getResources?parents=`15`&includeTVs=`1`&depth=`1`&tpl=`tendertmp`]]