0

我想使用来自 realurl 的 URL 创建一个包含 tx_news 的所有标签的列表。

标签的 RealURL 配置:

'tag' => array(
                array(
                    'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
                    'lookUpTable' => array(
                            'table' => 'tx_news_domain_model_tag',
                            'id_field' => 'uid',
                            'alias_field' => 'CONCAT(title, "-", uid)',
                            'addWhereClause' => ' AND NOT deleted',
                            'useUniqueCache' => 1,
                            'useUniqueCache_conf' => array(
                                    'strtolower' => 1,
                                    'spaceCharacter' => '-'
                            )
                    )
                )
            ),

现在列表是这样创建的:

newsTags = CONTENT
    newsTags {
      table = tx_news_domain_model_tag
      select {
        pidInList = 1,298
        hidden = 0
        deleted = 0
        orderBy = title
      }
      orderBy = title
      renderObj = COA
      renderObj {
        wrap = |
        1 = LOAD_REGISTER
        1 {
            Counter.cObject = TEXT
            Counter.cObject.data = register:Counter
            Counter.cObject.wrap = |+1
            Counter.prioriCalc = intval
        }
        2 = TEXT
        2.insertData = 1
        2.field = title
        2.wrap = <li data-index="{register:Counter}"><a href="/labels/tag/|-
        3 = TEXT
        3.field = uid
        3.wrap = |">

        5 = TEXT
        5.field = title
        5.wrap = |</a></li>

      }
      wrap = <ul>|</ul>
    }

暂时忽略注册表。URL 只是使用 Title-UID 生成的。有时标题中有一个点,然后 URL 不起作用。所以我很想使用 realurl 创建的 URL。这可能吗?

4

1 回答 1

2

在您的解决方案中,您正在尝试手动构建链接。我强烈建议使用typolink 来生成链接。如果 RealURL 可用并且在 RealURL 配置中配置了相应的 GET 参数,则 Typolink 会生成语音 URL。您只需要additionalParams为标签 UID 设置:

newsTags = CONTENT
newsTags {
    table = tx_news_domain_model_tag
    select {
        pidInList = 1,298
        hidden = 0
        deleted = 0
        orderBy = title
    }
    orderBy = title
    renderObj = COA
    renderObj {
        1 = LOAD_REGISTER
        1 {
            Counter.cObject = TEXT
            Counter.cObject.data = register:Counter
            Counter.cObject.wrap = |+1
            Counter.prioriCalc = intval
        }
        2 = TEXT
        2.field = title
        2.insertData = 1
        2.typolink {
            # link to current page
            parameter.current = 1
            # the current tag
            additionalParams = &tx_news_pi1[overwriteDemand][tags]={field:uid}
            additionalParams.insertData = 1
        }
        2.wrap = <li data-index="{register:Counter}">|</li>

    }
    wrap = <ul>|</ul>
}

您当然可以通过使用parameter = 999.

于 2014-12-02T16:40:17.600 回答