一页上的TYPO3内容按页面树中的位置排序 [英] TYPO3 content on one page order by position in pagetree

查看:59
本文介绍了一页上的TYPO3内容按页面树中的位置排序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在一页的子页面上显示所有内容:

I'm showing all content from the subpages on one page:

lib.allPid = COA
lib.allPid {
    10 = HMENU
    10 {
        #entryLevel = 1
                special = directory
                special.value = 115
        1 = TMENU
        1 {
            expAll = 1
            NO.doNotShowLink = 1
            NO.allStdWrap.field = uid
            NO.allStdWrap.wrap = |,
        }
        2 < .1
    }
}

lib.allContent = CONTENT
lib.allContent {
    table = tt_content
    select {
        pidInList.cObject < lib.allPid
                where = colPos = 0
                orderBy = pid DESC
    }
}

这里的内容是按pid DESC排序的.但是我想按子页面在页面树中的位置来排序内容.这样用户可以定义自己的顺序.

Here the content is ordere by pid DESC. But I'd like to order the content from the subpages by their position in the pagetree. So that the user can define his own ordering.

我尝试过:

lib.allContent = CONTENT
lib.allContent {
  table = tt_content
  select {
    pidInList.cObject < lib.allPid
    leftjoin = pages ON (tt_content.pid = pages.pid)
                where = tt_content.colPos = 0                    
                orderBy = pages.sorting ASC
  }
}

没用...

有人知道该怎么做吗?预先感谢!

Does anyone know how to do this? Thanks in advance!

推荐答案

您的方法不错,但是您将连接弄错了.

You are on a good way, but you made the join wrong.

在您的代码中为tt_content.pid = pages.pid,这是错误的. tt_content中的pid值是pages中的uid.

In your code it is tt_content.pid = pages.pid, and this one is wrong. The pid value in tt_content is the uid from the pages.

您需要更改脚本,以便:

You need to change your script so:

lib.allContent = CONTENT
lib.allContent {
  table = tt_content
  select {
    pidInList.cObject < lib.allPid
    leftjoin = pages ON (tt_content.pid = pages.uid)
                where = tt_content.colPos = 0                    
                orderBy = pages.sorting ASC
  }
}

我测试了它,并在一个测试实例上工作了.

I tested it, and it worked on a test instance.

这篇关于一页上的TYPO3内容按页面树中的位置排序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆