1

In Typo3 v9 I have routing installed as described here.

But there is always the path segment of the details page in the url.

Even if i write "news-of-the-month" in field "Speaking URL path segment" the url of the news is www.domain.com/details/news-of-the-month

But I want www.domain.com/news-of-the-month

Is that possible?

This is my 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'
Balindil
  • 11
  • 2

1 Answers1

0

You need at least one additional path segment (like "details"), because TYPO3 needs to find the page with your details view plugin, except your details view is on your root page. With a details view on your root page you might only want wo show it (via TypoScript condition), when there's a news selected:

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