[英]Create links to news-tags with the realurl URL
I would like to create a list of all tags für the tx_news with the URL from realurl. 我想用realurl中的URL创建所有标签到tx_news的列表。
RealURL Config for tags: 标签的RealURL Config:
'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' => '-'
)
)
)
),
Right now the list get created this way: 现在,以这种方式创建列表:
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>
}
ignore the register for now. 现在暂时忽略该寄存器。 The URL just get generated with Title-UID.
该URL仅通过Title-UID生成。 And sometimes the title have a dot in it and then the URL dont work.
有时标题中有一个点,然后URL不起作用。 So I would love to use the URL realurl creates.
所以我很想使用realurl创建的URL。 Is this possible?
这可能吗?
In your solution, you're trying to build the link manually. 在您的解决方案中,您尝试手动构建链接。 I strongly suggest to use typolink for generating links.
我强烈建议使用typolink生成链接。 If RealURL is available and the respective GET parameters are configured in the RealURL configuration, Typolink generates speaking URLs.
如果RealURL可用并且在RealURL配置中配置了相应的GET参数,则Typolink会生成语音URL。 You just need to set
additionalParams
for the tag UID: 你只需要设置
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>
}
You can of course set the target page differently by just using parameter = 999
. 当然,您可以仅使用
parameter = 999
来设置目标页面。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.