Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typo3 如何从url中排除详细信息页面的路径段?_Typo3_Tx News_Typo3 9.x - Fatal编程技术网

Typo3 如何从url中排除详细信息页面的路径段?

Typo3 如何从url中排除详细信息页面的路径段?,typo3,tx-news,typo3-9.x,Typo3,Tx News,Typo3 9.x,在Typo3 v9中,我已按说明安装了布线 但url中始终存在详细信息页面的路径段 即使我在“Speaking URL path segment”字段中写“当月新闻”,新闻的URL也是www.domain.com/details/news-of-the-month 但是我想要www.domain.com/news-of-the-month 可能吗 这是我的config.yaml: rootPageId: 1 base: / baseVariants: { } languages: -

在Typo3 v9中,我已按说明安装了布线

但url中始终存在详细信息页面的路径段

即使我在“Speaking URL path segment”字段中写“当月新闻”,新闻的URL也是www.domain.com/details/news-of-the-month

但是我想要www.domain.com/news-of-the-month

可能吗

这是我的config.yaml:

rootPageId: 1
base: /
baseVariants: {  }
languages:
  -
    title: Deutsch
    enabled: true
    languageId: '0'
    base: /
    typo3Language: de
    locale: de_DE.UTF-8
    iso-639-1: de
    navigationTitle: ''
    hreflang: de-DE
    direction: ''
    flag: de
errorHandling: {  }
routes: {  }
routeEnhancers:
  NewsPlugin:
    type: Extbase
    limitToPages:
      - 39
      - 40
      - 41
    extension: News
    plugin: Pi1
    routes:
      - { routePath: '/{news_title}', _controller: 'News::detail', _arguments: {'news_title': 'news'} }
    defaultController: 'News::detail'
    aspects:
      news_title:
        type: PersistedAliasMapper
        tableName: 'tx_news_domain_model_news'
        routeFieldName: 'path_segment'
        routeValuePrefix: '/'
      page:
        type: StaticRangeMapper
        start: '1'
        end: '100'
  DateMenu:
    type: Extbase
    extension: News
    plugin: Pi1
    routes:
      # Pagination:
      - routePath: '/page/{page}'
        _controller: 'News::list'
        _arguments:
          page: '@widget_0/currentPage'
        requirements:
          page: '\d+'
      - routePath: '/{news-title}'
        _controller: 'News::detail'
        _arguments:
          news-title: news
      # Date year:
      - routePath: '/dateFilter/{date-year}'
        _controller: 'News::list'
        _arguments:
          date-month: 'overwriteDemand/month'
          date-year: 'overwriteDemand/year'
          page: '@widget_0/currentPage'
        requirements:
          date-year: '\d+'
      # Date year + pagination:
      - routePath: '/dateFilter/{date-year}/page/{page}'
        _controller: 'News::list'
        _arguments:
          date-year: 'overwriteDemand/year'
          page: '@widget_0/currentPage'
        requirements:
          date-year: '\d+'
          page: '\d+'
      # Date year/month:
      - routePath: '/dateFilter/{date-year}/{date-month}'
        _controller: 'News::list'
        _arguments:
          date-month: 'overwriteDemand/month'
          date-year: 'overwriteDemand/year'
          page: '@widget_0/currentPage'
        requirements:
          date-month: '\d+'
          date-year: '\d+'
       # Date year/month + pagination:
      - routePath: '/dateFilter/{date-year}/{date-month}/page/{page}'
        _controller: 'News::list'
        _arguments:
          date-month: 'overwriteDemand/month'
          date-year: 'overwriteDemand/year'
          page: '@widget_0/currentPage'
        requirements:
          date-month: '\d+'
          date-year: '\d+'
          page: '\d+'
    defaultController: 'News::list'
    defaults:
      page: '0'
      date-month: ''
      date-year: ''
    aspects:
      news-title:
        type: PersistedAliasMapper
        tableName: tx_news_domain_model_news
        routeFieldName: path_segment
      page:
        type: StaticRangeMapper
        start: '1'
        end: '25'
      date-month:
        type: StaticValueMapper
        map:
          '01': '01'
          '02': '02'
          '03': '03'
          '04': '04'
          '05': '05'
          '06': '06'
          '07': '07'
          '08': '08'
          '09': '09'
          '10': '10'
          '11': '11'
          '12': '12'
      date-year:
        type: StaticRangeMapper
        start: '2000'
        end: '2030'

您至少需要一个额外的路径段(如“详细信息”),因为TYPO3需要使用您的详细信息视图插件查找页面,但您的详细信息视图位于您的根页面上。如果根页面上有详细信息视图,则您可能只希望在选择新闻时显示该视图(通过打字输入条件):

[page["uid"] == 1 && (request.getQueryParams()['tx_news_pi1'])['news'] > 0]
# enable news plugin with detail view
[end]

您至少需要一个额外的路径段(如“详细信息”),因为TYPO3需要使用您的详细信息视图插件查找页面,但您的详细信息视图位于您的根页面上。如果根页面上有详细信息视图,则您可能只希望在选择新闻时显示该视图(通过打字输入条件):

[page["uid"] == 1 && (request.getQueryParams()['tx_news_pi1'])['news'] > 0]
# enable news plugin with detail view
[end]

但在使用realurl的版本8中,它起了作用。这是不是意味着它不再工作了?我想是的。但是通过根页面应该不费吹灰之力就可以实现,但在使用realurl的版本8中,它起到了作用。这是不是意味着它不再工作了?我想是的。但这应该可以通过根页面实现,而无需付出太多的努力