【问题标题】:MODX revolution: get second level childrenMODX革命:获得二级孩子
【发布时间】:2017-08-22 17:49:35
【问题描述】:

我有网址:somesite.com/mypage?clinic=21&spec=myspecialisation

在我的结构中,我有诊所 -> 父母 -> 要整理的最终资源

我有这个:

[[!getPage? 
    &elementClass=`modSnippet` 
    &element=`getResources` 
    &parents=`10,15,12`
    &resources=`-7,-8`
    &depth=`2`
    &limit=`21` 
    &pageVarKey=`page` 
    &includeTVs=`1` 
    &includeContent=`1` 
    &tpl=`pageAllDoctors` 
    &hideContainers=`true`
    &sortby=`FIELD(modResource.id, 456,331,390,491,2756,505,634,699,941,1044,1377,1436,1449,1678,1722,1711,1828,2007,2094,2184,2324,2487,2527)`
    &where=`[{"introtext:LIKE":"%[[!searchFieldClinic? &field=`spec`]]%", "AND:template:=":104}]`]]
[[+total:is=``:then=`&nbsp;&nbsp;&nbsp;&nbsp;nothing found.<br/><br/><br/>`:else=``]]

它使用从 url &spec=myspecialisation 获取的 introtext 完美地整理页面

问题:getPage 语句中的&amp;parents=10,15,12 列表应该是url 中clinic=21 参数中指定的页面的子页面列表

我该怎么做? 提前非常感谢。

【问题讨论】:

    标签: modx-revolution modx-resources


    【解决方案1】:
    &parents='21' &hideContainers='1' 
    

    您将隐藏诊所的孩子,他们是其他资源的父母。也许你应该增加&amp;depth

    【讨论】:

    • 碰巧 &parents=[[!searchFieldClinic? &amp;field='clinic']] 很好。没想到 modx 会理解这一点并深入到第二级孩子:)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-26
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多