【问题标题】:ModX getResources &tvFilters not workingModX getResources & tvFilters 不工作
【发布时间】:2018-04-10 21:28:06
【问题描述】:

我有来自 getResourses 的输出,需要按模板变量值排序,但过滤器显示的资源只有一个值。

例如,此代码显示的资源只有Manhattan TV 值。 模板变量输入类型为Tag,输出类型为默认。我已尝试将输入类型更改为自动标记。

[[!getPage@Series?
&element=`getResources`
&parents=`[[*id]]`
&tpl=`New-series-catalog`
&limit=`0`
&debug=`1`
&includeTVs=`1`
&processTVs=`1`
&tvFilters=`door-color==Manhattan`
&tvPrefix=``
]]

Screenshot of TV input options

Output with intentionally broken tpl name

TV value of resource that doesn't output, but should because it has Manhattan tag

我尝试仅使用英文值名称并将搜索值更改为俄文值名称,但结果相同。

【问题讨论】:

    标签: filter modx modx-revolution template-variables modx-getresources


    【解决方案1】:

    我找到了答案。

    要按具有多个值的电视进行过滤,您需要将 % % 添加到该值。

    例如,我的代码应该是这样的

    [[!getPage@Series?
    &element=`getResources`
    &parents=`[[*id]]`
    &tpl=`New-series-catalog`
    &limit=`0`
    &debug=`1`
    &includeTVs=`1`
    &processTVs=`1`
    &tvFilters=`door-color==%Manhattan%`
    &tvPrefix=``
    ]]
    

    代替

    [[!getPage@Series?
    &element=`getResources`
    &parents=`[[*id]]`
    &tpl=`New-series-catalog`
    &limit=`0`
    &debug=`1`
    &includeTVs=`1`
    &processTVs=`1`
    &tvFilters=`door-color==Manhattan`
    &tvPrefix=``
    ]]
    

    我希望这会对您有所帮助,这样您就不会浪费时间试图找出问题所在。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-01-16
      • 2019-07-30
      • 2013-09-29
      • 2012-10-27
      • 2015-02-14
      • 2011-06-19
      • 2016-05-05
      相关资源
      最近更新 更多