使用 realurl URL 创建指向新闻标签的链接



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

标签的 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。这可能吗?

在你的解决方案中,你尝试手动生成链接。我强烈建议使用错别字链接来生成链接。如果 RealURL 可用,并且在 RealURL 配置中配置了相应的 GET 参数,则拼写链接会生成语音 URL。您只需为标记 UID 设置additionalParams

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来设置目标页面。

相关内容

  • 没有找到相关文章

最新更新