我有這個資源,pagetitles:modx如何過濾出頁眉開頭的所有資源的特定信件?
我怎樣才能在getResources,篩選出只有PAGETITLE開始對p或a到b或é到g(文件而不是一個容器,但我知道如何做到這一點)?
我有這個資源,pagetitles:modx如何過濾出頁眉開頭的所有資源的特定信件?
我怎樣才能在getResources,篩選出只有PAGETITLE開始對p或a到b或é到g(文件而不是一個容器,但我知道如何做到這一點)?
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
感謝@ proxyfabio提供了很大的幫助,並指導我朝着正確的方向發展。
我得到了最簡單的感謝方式,在鏌鋣論壇@sottwell:
&where=`{"pagetitle:LIKE":"p%"}`
和
&where=`{"pagetitle:LIKE":"l%","OR:pagetitle:LIKE":"m%","OR:pagetitle:LIKE":"n%","OR:pagetitleon:LIKE":"o%"}`
一樣容易。
謝謝!大。但現在我不幸陷入了點和斜線。你能幫我解決這個問題嗎?這個例子是顯示以字母「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}']] –
'where'條件存在錯誤。我使用=>,因爲它是數組。 哪裏有條件等待JSON。你必須試試這個: &where =「{」pagetitle:REGEXP「:」^([p]){1}(。*)$「,」isfolder:=「:0}' – proxyfabio