Пагинация не отображается - PullRequest
0 голосов
/ 02 апреля 2020

Я использую расширение Системы новостей и TYPO3 v9.

После установки routeEnhancers нумерация страниц полностью скрыта от страниц категорий.

, т. Е. Когда URL-адрес: example.com/cat/category-name нумерация страниц не отображается,

и при URL-адресе: example.com/page?tx_news_pi1%5BoverwriteDemand%5D%5Bcategories%5D=13 отображается нумерация страниц.

Это мой config.yaml:

rootPageId: 1
routes: {  }
routeEnhancers:
NewsPlugin:
    type: Extbase
    extension: News
    plugin: Pi1
    routes:
        - { routePath: '/page/{page}', _controller: 'News::list', _arguments: {'page': '@widget_0/currentPage'} }
        - { routePath: '/{news_title}', _controller: 'News::detail', _arguments: {'news_title': 'news'} }          
        - { routePath: '/{category-name}', _controller: 'News::list', _arguments: {'category-name': 'overwriteDemand/categories'} }

    defaultController: 'News::list'
    defaults:
        page: '0'
    requirements:
        page: '\d+'
        news_title: '^[a-zA-Z0-9].*$'
    aspects:
        page:
            type: StaticRangeMapper
            start: '1'
            end: '100'

        category-name:
            type: PersistedAliasMapper
            tableName: sys_category
            routeFieldName: slug

        news_title:
            type: PersistedPatternMapper
            tableName: tx_news_domain_model_news
            routeFieldPattern: '^(?P<path_segment>.+)'
            routeFieldResult: '{path_segment}'

1 Ответ

0 голосов
/ 04 апреля 2020

Я решил это

Убедитесь, что: hidePagination установлен на 0 на вашем TS: lib.news.settings.hidePagination = 0

Это мой config.yaml после редактирования:

routes: {  }
routeEnhancers:
News:
type: Extbase
extension: News
plugin: Pi1
routes:
  - routePath: '/'
    _controller: 'News::list'

  - routePath: '/page-{page}'
    _controller: 'News::list'
    _arguments:
      page: '@widget_0/currentPage'

  - routePath: '/{news-title}'
    _controller: 'News::detail'
    _arguments:
      news-title: news

  - routePath: '/{category-name}/{page}'
    _controller: 'News::list'
    _arguments:
      category-name: 'overwriteDemand/categories'
      page: '@widget_0/currentPage'
    requirements:
      category-name: '\d+'
      page: '\d+'

defaultController: 'News::list'
defaults:
  page: '0'
aspects:
  news-title:
    type: PersistedAliasMapper
    tableName: tx_news_domain_model_news
    routeFieldName: path_segment
  page:
    type: StaticRangeMapper
    start: '1'
    end: '100'
  category-name:
    type: PersistedAliasMapper
    tableName: sys_category
    routeFieldName: slug

Может это поможет

...