modx revo:寻路器不按菜单索引排序
默认情况下,modx revo 中的 wayfinder 插件应按菜单索引排序。这似乎不起作用。我有以下内容:
[[!Wayfinder? &startId=`2` &level=`1` &ignoreHidden=`TRUE` &outerClass=`news` &sortBy=`menuindex` &sortOrder=`DESC`]]
我怀疑这是我忽略的愚蠢的事情...
编辑:我现在已经让它工作了。
我查看了 wayfinder.class.php
中的 wayfinder 代码。以下行被注释掉:
$c->groupby($this->modx->getSelectColumns('modResource','modResource','',array('id')));
发生这种情况是因为代码中的以下注释:
/* not sure why this groupby is here in the first place. removing for now as it causes issues with the sortby clauses */
也许这会对将来的某人有所帮助。
By default, the wayfinder plugin in modx revo should sort by menuindex. This doesn't seem to work. I have the following:
[[!Wayfinder? &startId=`2` &level=`1` &ignoreHidden=`TRUE` &outerClass=`news` &sortBy=`menuindex` &sortOrder=`DESC`]]
I suspect it's something stupid I overlooked...
EDIT: I've made it work now.
I looked into the wayfinder code in wayfinder.class.php
. The following line was commented out:
$c->groupby($this->modx->getSelectColumns('modResource','modResource','',array('id')));
It happened because of the following comment in the code:
/* not sure why this groupby is here in the first place. removing for now as it causes issues with the sortby clauses */
Maybe this will help someone in the future.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我查看了 wayfinder.class.php 中的 wayfinder 代码 以下行被注释: $c->groupby($this->modx->getSelectColumns('modResource','modResource','',array(' ID')));
它被注释掉是因为代码中的以下注释:
/* 不确定为什么这个 groupby 首先在这里。现在删除,因为它会导致 sortby 子句出现问题 */
也许这对将来的任何人都有帮助
I looked at the wayfinder code in wayfinder.class.php The following line was commented: $c->groupby($this->modx->getSelectColumns('modResource','modResource','',array('id')));
It was commented out because of the following comment in the code:
/* not sure why this groupby is here in the first place. removing for now as it causes issues with the sortby clauses */
Maybe this helps anyone in the future