typo3 - TYPO3 新闻路由无法正常工作。但它在站点地图中显示的 URL 中工作
问题描述
以下是config.yaml
使详细信息页面 URL 用户友好的配置。
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
但是得到的网址是:https://www.example.com/article/?tx_news_pi1%5Bnews%5D=1&cHash=0bfd8bb6d92152b35569116fa86a2406
其他项目也使用相同的代码它在那里完美地工作。但在我的 sitemap.xml 中,我可以在那里看到正确的 URL。
谁能帮我?为什么 URL 仅在站点地图中是正确的。
谢谢你。
解决方案
我发现了问题。
link {
skipControllerAndAction = 1
}
我的新闻设置中有一个 skipControllerandAction。我已经删除了它,现在它运行良好。
谢谢!!
推荐阅读
- python - dataset = dataset[0:num_images, :, :] 代码是做什么的?
- vba - VBA Word 复制表的值而不引用表的序列号
- svelte - 新项目的工兵还是苗条?
- c++11 - leetcode 运行时错误:添加无符号偏移量
- uno-platform - Uno WinUI 3.0 模板:UWP 和 Droid 中的不同命名空间
- python - 如何使用 xpath 单击带有 role=button 的标签?
- reactjs - 如果状态为真,如何检查第一次渲染?
- tsql - ROW_NUMBER() 按 [DateCol vs 1] 分区按 DateCol 排序
- ruby - Ruby NoMethodError(未定义的方法 ''...' for '....:Class'
- c# - 如何从另一个访问 UserControl 中的文本框