2014-02-20 28 views

回答

2

Xpdo查詢例如:

$c = $modx->newQuery('modResource'); 
$c->where(array(
    'pagetitle:REGEXP' => '^([a-b]|[e-g]|p){1}(.*)$' 
    ,'isfolder' => 0 
)); 
$d = $modx->getCollection('modResource',$c); 

如果你想使用這個在getResources段緊挨着增加PAGETITLE和isfolder條件「其中」這樣的屬性已完成there

+0

謝謝!大。但現在我不幸陷入了點和斜線。你能幫我解決這個問題嗎?這個例子是顯示以字母「p」開頭的所有文檔的調用:[[getResources?parents ='3'&depth ='4'&tpl ='photoListSort'&display ='all'&sortby ='pagetitle'&sortdir ='ASC '& includeTVs ='1'&processTVs ='1'&tvPrefix =''&hideContainers ='1'&where = {{pagetitle:=「:REGEXP =>'^([p]){1}(。*)$' 「isfolder:=」:0}']] –

+0

'where'條件存在錯誤。我使用=>,因爲它是數組。 哪裏有條件等待JSON。你必須試試這個: &where =「{」pagetitle:REGEXP「:」^([p]){1}(。*)$「,」isfolder:=「:0}' – proxyfabio

2

感謝@ proxyfabio提供了很大的幫助,並指導我朝着正確的方向發展。

我得到了最簡單的感謝方式,在鏌鋣論壇@sottwell:

&where=`{"pagetitle:LIKE":"p%"}` 

&where=`{"pagetitle:LIKE":"l%","OR:pagetitle:LIKE":"m%","OR:pagetitle:LIKE":"n%","OR:pagetitleon:LIKE":"o%"}` 

一樣容易。

相關問題