Typo3 如何使用RealUrl从tx_新闻详细信息视图中缩短url?
我喜欢打字3:1000条通往罗马的路 以下是我在TYPO3 7.6和tx_news 5.2上的尝试,提供了很好的Url详细视图: 如何将url从“detail/”缩短 谢谢你的提示 第一条“罗马之路”: 第二:Typo3 如何使用RealUrl从tx_新闻详细信息视图中缩短url?,typo3,tx-news,Typo3,Tx News,我喜欢打字3:1000条通往罗马的路 以下是我在TYPO3 7.6和tx_news 5.2上的尝试,提供了很好的Url详细视图: 如何将url从“detail/”缩短 谢谢你的提示 第一条“罗马之路”: 第二: [globalVar = GP:tx_news_pi1|news > 0] config.defaultGetVars { tx_news_pi1 { controller=News action=detail } } [global
[globalVar = GP:tx_news_pi1|news > 0]
config.defaultGetVars {
tx_news_pi1 {
controller=News
action=detail
}
}
[global]
文件:
缩短URL的另一种方法: 在realURLconfiguration文件中使用以下编码和解码函数:
- 'encodeSpURL\u postProc'=>数组('user\u encodeSpURL\u postProc'),
- 函数用户\u encodeSpURL\u postProc(&$params,&$ref){
$params['URL']=str_replace('News/Details/'、'News/'、$params['URL']); }
- 函数用户\u encodeSpURL\u postProc(&$params,&$ref){
- 'decodeSpURL\u preProc'=>数组('user\u decodeSpURL\u preProc')
- 函数用户\u decodeSpURL\u预处理(&$params,&$ref){
$params['URL']=str_replace('News/'、'News/Details/'、$params['URL']); }
- 函数用户\u decodeSpURL\u预处理(&$params,&$ref){
[globalVar = GP:tx_news_pi1|news > 0]
config.defaultGetVars {
tx_news_pi1 {
controller=News
action=detail
}
}
[global]