TYPO3 新闻路由无法正常工作.但它在站点地图中显示的 URL 中工作 [英] TYPO3 News routing not working properly. But its working in the URL showing in Sitemap

查看:25
本文介绍了TYPO3 新闻路由无法正常工作.但它在站点地图中显示的 URL 中工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下是我的 config.yaml 配置,以使详细信息页面 URL 用户友好.

Following is my config.yaml configuration to make the detail page URL user friendly.

News:
type: Extbase
limitToPages:
  - 23
extension: News
plugin: Pi1
routes:
  -
    routePath: '{news_title}'
    _controller: 'News::detail'
    _arguments:
      news_title: news
  -
    routePath: '/topic/{category_name}'
    _controller: 'News::list'
    _arguments:
      category_name: overwriteDemand/categories
defaultController: 'News::list'
defaults:
  page: '0'
requirements:
  news_title: '^[a-zA-Z0-9].*$'
  page: \d+
aspects:
  news_title:
    type: PersistedAliasMapper
    tableName: tx_news_domain_model_news
    routeFieldName: path_segment
  category_name:
    type: PersistedAliasMapper
    tableName: sys_category
    routeFieldName: path_segment
NewsList:
type: Plugin
routePath: '/browse/{@widget_0/currentPage}'
namespace: tx_news_pi1
aspects:
  '@widget_0/currentPage':
    type: StaticRangeMapper
    start: '1'
    end: '1000'

我需要一个像这样的网址:https://www.example.com/article/lorem-ipsum-dolor

I need a URL like: https://www.example.com/article/lorem-ipsum-dolor

但是得到的网址是:https://www.example.com/article/?tx_news_pi1%5Bnews%5D=1&cHash=0bfd8bb6d92152b35569116fa86a2406

在其他项目中也使用了相同的代码它在那里完美地工作.但是在我的 sitemap.xml 中,我可以在那里看到正确的 URL.

The same code is used in other projects too It is perfectly working there. But in my sitemap.xml I can see the correct URL There.

谁能帮帮我?为什么 URL 仅在站点地图中是正确的.

Can anyone help me? Why the URL is correct only in the sitemap.

谢谢.

推荐答案

我发现了问题.

link {
    skipControllerAndAction = 1
}

我的新闻设置中有一个 skipControllerandAction.我已经删除了它,现在它运行良好.

There is a skipControllerandAction in my news setup. I have removed this and now it working well.

谢谢!!

这篇关于TYPO3 新闻路由无法正常工作.但它在站点地图中显示的 URL 中工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆