url - 如何在Typo3 9.5.0上获取新闻7.0.7的口述URL

标签 url url-rewriting typo3 tx-news typo3-9.x

我真的很喜欢Typo3 9.5.0轻松创建口语URL。

我唯一要解决的问题是使其与新闻之类的扩展一起使用。
无法找到使它正常工作的方法,也不知道从哪里开始。感谢您的帮助。

此致


TYPO3 9.5.0
新闻7.0.7

最佳答案

您可以使用站点配置YAML文件(通常是htdocs/config/sites//config.yaml)中的routeEnhancers指令来执行此操作。官方文档中有一个示例,尽管有点隐藏:

https://docs.typo3.org/typo3cms/extensions/core/Changelog/9.5/Feature-86365-RoutingEnhancersAndAspects.html

这是我正在积极使用的配置:

rootPageId: <site id>
...
routeEnhancers:
 NewsPlugin:
  type: Extbase
  limitToPages:
    - 49 (when your news detail page id is 49)
    - ...
  extension: News
  plugin: Pi1
  routes:
    -
     routePath: '/blog/{page}'
     _controller: 'News::list'
     _arguments:
       page: '@widget_0/currentPage'
    -
     routePath: '/tag/{tag_name}'
     _controller: 'News::list'
     _arguments:
       tag_name: overwriteDemand/tags
    -
     routePath: '/{news_title}'
     _controller: 'News::detail'
     _arguments:
       news_title: news
    -
     routePath: '/archive/{year}/{month}'
     _controller: 'News::archive'
  defaultController: 'News::list'
  defaults:
   page: '0'
  aspects:
   news_title:
    type: PersistedAliasMapper
    tableName: tx_news_domain_model_news
    routeFieldName: path_segment

关于url - 如何在Typo3 9.5.0上获取新闻7.0.7的口述URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52983851/

相关文章:

regex - Django 1.3 传递参数以过滤 url.py 中基于类的通用 ListView

url - Azure 网站 - 使用 web.config 进行 URL 重写不起作用

database - 如何在 Typo3 6.1.5 中使用 PHP 在我的扩展中从 tt_content 呈现内容对象

typo3 - 依赖注入(inject)在 BE Ajax 调用中不起作用

php - 我如何在 php 中编码和解码来自 IDN 的 url?

django - 找不到页面 - 如何查找 Django URL 中的当前路径是否有效?

javascript - 如何在不影响速度的情况下打开多个 puppeteer 实例

asp.net - 使用 IIS7 URL 重写模块将其他域重定向到主 .com 域

php - htaccess - 如果 POST 数据不重写 URL

typo3 - 自定义 CTypes : Position in type dropdown