开始值和最大值可配置(TypoScript - 内容)

发布于 2024-12-19 14:16:40 字数 769 浏览 2 评论 0原文

我正在 TS 中做一种分页器...... 我正在做一个选择,但我需要配置(从 GP:var)开始(设置“开始”页面)值...但我找不到办法做到这一点...

我一直在寻找对于它在谷歌,每个人都说它是一个 int+calc 对象...但是如果我不能在 calc 中设置变量,我不明白作为 int+calc 的想法...

我给你一个我的代码的例子

10.select {
    pidInList.insertData = 1
    pidInList = this
    max = 5
    begin = 0    #Here is where I would like to configure the begin dynamicaly with stdWrap or something like that
    orderBy = pages_smc_news.date DESC
    leftjoin = pages_smc_news ON(pages_smc_news.pid = pages.uid) LEFT JOIN tt_content ON (tt_content.pid = pages.uid)
    selectFields = pages_smc_news.date, title, bodytext, header,tt_content.pid
    where = header="teaser"
    andWhere = tt_content.sys_language_uid = 0
}
10.renderObj = COA
10.renderObj {
    ...
}
...

I'm doing a kind of paginator in TS...
I'm doing a select, but I need to confugre (from a GP:var) the begin (to set the "begin" page) value... But I dont find a way to do that...

I have been looking for it in Google, and everybody says it is a int+calc object... But I dont understand the idea of being a int+calc if I cant set a variable in the calc...

I let you an example of my code

10.select {
    pidInList.insertData = 1
    pidInList = this
    max = 5
    begin = 0    #Here is where I would like to configure the begin dynamicaly with stdWrap or something like that
    orderBy = pages_smc_news.date DESC
    leftjoin = pages_smc_news ON(pages_smc_news.pid = pages.uid) LEFT JOIN tt_content ON (tt_content.pid = pages.uid)
    selectFields = pages_smc_news.date, title, bodytext, header,tt_content.pid
    where = header="teaser"
    andWhere = tt_content.sys_language_uid = 0
}
10.renderObj = COA
10.renderObj {
    ...
}
...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

往日情怀 2024-12-26 14:16:40

在 TYPO3 4.5.x(甚至可能是早期版本)中,您可以使用 选择。这使您可以定义可在其他 select 属性中使用的标记(例如 ###some_marker###)。

10.select {
    pidInList.insertData = 1
    pidInList = this
    max = 5
    begin = ###begin###
    orderBy = pages_smc_news.date DESC
    leftjoin = pages_smc_news ON(pages_smc_news.pid = pages.uid) LEFT JOIN tt_content ON (tt_content.pid = pages.uid)
    selectFields = pages_smc_news.date, title, bodytext, header,tt_content.pid
    where = header="teaser"
    andWhere = tt_content.sys_language_uid = 0
    markers {
        begin = TEXT
        begin {
            data = GP:var
            intval = 1
        }
    }
}

In TYPO3 4.5.x (maybe even in earlier versions) you can use markers property of the select. This lets you define markers (e.g. ###some_marker###) that you can use in other select properties.

10.select {
    pidInList.insertData = 1
    pidInList = this
    max = 5
    begin = ###begin###
    orderBy = pages_smc_news.date DESC
    leftjoin = pages_smc_news ON(pages_smc_news.pid = pages.uid) LEFT JOIN tt_content ON (tt_content.pid = pages.uid)
    selectFields = pages_smc_news.date, title, bodytext, header,tt_content.pid
    where = header="teaser"
    andWhere = tt_content.sys_language_uid = 0
    markers {
        begin = TEXT
        begin {
            data = GP:var
            intval = 1
        }
    }
}
十级心震 2024-12-26 14:16:40

也许您可以使用寄存器来存储和累积开始变量并覆盖它?每次我的代码将寄存器变量“num”与 1(一种 t3 cookie 变量)相加,当您加载另一个页面时,它就会被删除。

  begin.stdWrap.cObject = COA
  begin.stdWrap.cObject {
       10 = LOAD_REGISTER
       10.num.cObject = TEXT
       10.num.cObject.data = register:num
       10.num.cObject.wrap = |+1
       10.num.prioriCalc = intval
  }

Perhaps you can use a register to store and accumulate the begin variable and override it? Each time my code add up the register variable "num" with a 1 which is a kind of t3 cookie variable, it get erased when you load another page.

  begin.stdWrap.cObject = COA
  begin.stdWrap.cObject {
       10 = LOAD_REGISTER
       10.num.cObject = TEXT
       10.num.cObject.data = register:num
       10.num.cObject.wrap = |+1
       10.num.prioriCalc = intval
  }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文