remind/extbase

REMIND - Extbase

安装: 291

依赖: 2

建议者: 0

安全: 0

星标: 0

关注者: 0

分支: 0

公开问题: 0

类型:typo3-cms-extension

v1.2.0 2024-05-02 13:44 UTC

This package is auto-updated.

Last update: 2024-09-26 07:17:23 UTC


README

本扩展提供基本功能,可在其他extbase扩展中使用,主要配置和工具/服务用于插件,以实现一致的列表、过滤和详细视图。

ExtbaseQuery 路由增强器

ExtbaseQuery 路由增强器将extbase插件查询参数替换为自定义名称,并省略动作和控制器参数。

limitToPages

对于ExtbaseQuery路由增强器的工作是必需的,因为没有限制,所有路由都将匹配。

默认值

行为与此处描述相同。

命名空间、扩展、插件、_控制器

行为与此处描述相同。

参数

参数分为键和值。在两者中,使用原始参数名称作为键,使用方面名称作为值。在键中,可以使用新的参数名称作为值而不是方面。

方面

用于参数中定义的键和值的方面。参数键的方面必须实现ModifiableAspectInterface,而参数值的方面必须实现MappableAspectInterface

类型

限制路由增强器到某些页面类型,例如增强solr搜索结果路由但不增强自动完成路由。默认为[0]

新闻扩展的示例

  News:
    limitToPages: [20]
    type: ExtbaseQuery
    extension: News
    plugin: Pi1
    _controller: 'News::list'
    defaults:
      page: '1'
    parameters:
      values:
        currentPage: pageValue
        overwriteDemand/categories: categoryValue
      keys:
        currentPage: page
        overwriteDemand/categories: categoryKey
    aspects:
      pageValue:
        type: StaticRangeMapper
        start: '1'
        end: '5'
      categoryValue:
        type: PersistedAliasMapper
        tableName: sys_category
        routeFieldName: slug
      categoryKey:
        type: LocaleModifier
        default: category
        localeMap:
          -
            locale: 'de_DE.*'
            value: kategorie

FilterValueMapper

用于修改过滤键和检查过滤值。过滤查询参数使用数组语法,如?filter[name]=...&filter[title]=...,而FilterValueMapper允许使用方面更改数组键。此外,仅允许在tt_contentpi_flexform字段中定义的、配置中定义的CType的值。在parametersaspects中,行为与ExtbaseQuery Route Enhancer配置相同。

对于?filter[name]=...&filter[title]=...的示例

aspects:
  filter:
    type: FilterValueMapper
    tableName: tx_contacts_domain_model_contact
    cType: contacts_filterablelist
    parameters:
      keys:
        name: Name
        title: titleKey
    aspects:
      titleKey:
        type: LocaleModifier
        default: Title
        localeMap:
          -
            locale: 'de_DE.*'
            value: Titel

使用此设置,查询参数将如下所示

英文:?filter[Name]=...&filter[Title]=...

德语:?filter[Name]=...&filter[Titel]=...