josefglatz/cropvariantsbuilder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

josefglatz/cropvariantsbuilder

Composer 安装命令:

composer require josefglatz/cropvariantsbuilder

包简介

Simplify writing cropVariants for TYPO3 Integrators/Developers

README 文档

README

TYPO3 extension to simplify writing cropVariants for TYPO3 Integrators/Developers

→ → → Table of Contents
  1. About
    1. Past
    2. Present
    3. Future
  2. Installation
    1. Installation using Composer
    2. Installation as extension from TYPO3 Extension Repository (TER)
  3. Configuration
    1. Name of the extension where the general configuration file lives
    2. Example of using your own CropVariants.yaml file
    3. Example of using your own CropVariants.yaml file while using the \TYPO3\CMS\Core\Configuration\Loader\YamlFileLoader->load() imports feature
  4. Detailed manual and more examples
    1. Handling of cropVariants in TYPO3
      1. Centralized configuration for AspectRatio, Cover-/CropArea presets and CropVariant definitions
      2. Handling of cropVariants in TYPO3: Simplified cropVariants configuration for the Table Configuration Array
    2. Defaults And Presets
    3. CropVariantsBuilder
      1. Example 1: Set a global default cropVariants configuration
      2. Example 2: Set custom cropVariants for a specific field of a specific table (pages.tx_my_nice_site_extension_nav_image)
      3. Example 3: Set custom cropVariants for tx_news_domain_model_news.fal_media
      4. Example 4: Set custom cropVariants for tt_content.image for CType tx_my_nice_site_extension_custom_ce1
    4. Translation logic for cropVariant label

About

This extensions centralizes the configuration of

  • default aspectRatios,
  • aspectRatios used within the TYPO3 instance,
  • coverAreas used within the TYPO3 instance,
  • cropAreas used within the TYPO3 instance,
  • focusAreas used within the TYPO3 instance.

This extension makes it easy to configure cropVariants within TCA (EXT:your_ext/Configuration/TCA/**/*.php) modifications in your "site package" extension.

The extension relies 100% on the TYPO3 core functionality and can be seen as an on-top-time-saver for TYPO3 integrators.

Past

The initial public version was part of https://github.com/josefglatz/TYPO3-Distribution. The demands grew in 2019 and therefore I came up with a new idea to support also the TYPO3 site configuration which was introduced in TYPO3 9.5 LTS.

Present

This extension doesn't support the TYPO3 site configuration. With that known fact, it's not possible to distinguish between multiple sites in a multitree environment.

Future

The functionality of this extension will stay as it is. There will be no direct successor to which you can update and migrate automatically (from my current perspective). I will link the new extension here when it's publicly available.

At the time of writing about the future my plan is to re-adding the functionality completely via the TYPO3 site configuration and the FormDataProvider. With that in mind, it's possible to make site specific configurations. Even the configuration can be done completely via a YAML file beside your existing YAML file of one configured site.

If it makes really sense, I probably add also the functionality of EXT:cropvariantsbuilder to make global TCA modifications possible (not yet specified if you have to write YAML or the known PHP syntax).

Installation

Installation using Composer

The recommended way to install the extension is by using Composer. In your Composer based TYPO3 project root, just do composer require josefglatz/cropvariantsbuilder.

Installation as extension from TYPO3 Extension Repository (TER)

Download and install the extension with the TYPO3 CMS extension manager module or directly via typo3.org.

Version Matrix

TYPO3 version Extension version notes
8.7-10.4 1.0.1 no breaking changes
10.4-11.5 1.0.3 no breaking changes
11.5-12.4 >=2.0.0 translation fallback logic removed
13.4 >=2.0.1 no breaking changes since 2.0.0
14.1 >=3.0.1 no breaking changes since 2.0.0

Development

The ongoing development is done within the main branch!

You can use composer require josefglatz/cropvariantsbuilder:dev-main if you want to test the current development state.

Configuration

Name of the extension where the general configuration file lives

The following options must be set within the TYPO3 extension configuration:

configurationProviderExtension = my_nice_site_extension

So if you place the configuration file in EXT:my_nice_site_extension/Configuration/ImageManipulation/CropVariants.yaml you have to set the value to my_nice_site_extension.

configurationProviderLocallangFilename = locallang

So if you place the translations in EXT:my_nice_site_extension/Resources/Private/Language/locallang.xlf you have to set the value to locallang. Read more about the supported translation logic.

The following example shows the resulting PHP configuration part:

// TYPO3 >= 9.5 LTS:
$GLOBALS['TYPO3_CONF_VARS']['EXTENSIONS']['cropvariantsbuilder'] = [
    'configurationProviderExtension' => 'my_nice_site_extension',
    'configurationProviderLocallangFilename' => 'locallang',
];

// TYPO3 =< 8.7 LTS
$GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['cropvariantsbuilder'] = serialize([
    'configurationProviderExtension' => 'my_nice_site_extension',
    'configurationProviderLocallangFilename' => 'locallang',
]);

Example of using your own CropVariants.yaml file

Just clone the file EXT:cropvariantsbuilder/Configuration/ImageManipulation/CropVariants.yaml to EXT:my_nice_site_extension/Configuration/ImageManipulation/CropVariants.yaml and modify it however you want. With that approach, you have no dependencies on the default CropVariants.yaml of EXT:cropvariantsbuilder.

Example of using your own CropVariants.yaml file while using the \TYPO3\CMS\Core\Configuration\Loader\YamlFileLoader->load() imports feature

The following example represents the content of the file EXT:my_nice_site_extension/Configuration/ImageManipulation/CropVariants.yaml.

imageManipulation:
  cropVariants:
    defaults:
      aspectRatios:
        "1.91:1":
          title: "This is the new title for an existing aspectRatio within EXT:cropvariantsbuilder"
        "123:321":
          title: "Completely new introduced aspect ratio"
          value: 123 / 321

      defaultCropVariantsConfiguration:
        default:
          aspectRatios:
            - "3:2"
            - "2:3"
            - "123:321"
            - "NaN"

imports:
  -
    resource: 'EXT:cropvariantsbuilder/Configuration/ImageManipulation/CropVariants.yaml'

You can rely on the default CropVariants.yaml of EXT:cropvariantsbuilder while modifying it to meet the demands of your specific project with the example shown above. And of course, you can import any other YAML file. You don't have to rely on the default CropVariants.yaml if the resulting YAML file includes a configuration for every necessary part.

Detailed manual and more examples

Cheers to all TYPO3 enthusiasts out there!

Created by

http://josefglatz.at/

Support

Many thanks to my employer supseven.at for sponsoring work time.

josefglatz/cropvariantsbuilder 适用场景与选型建议

josefglatz/cropvariantsbuilder 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24.46k 次下载、GitHub Stars 达 7, 最近一次更新时间为 2020 年 01 月 08 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「extension」 「typo3」 「imagemanipulation」 「cropvariant」 「cropvariants」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 josefglatz/cropvariantsbuilder 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 josefglatz/cropvariantsbuilder 我们能提供哪些服务?
定制开发 / 二次开发

基于 josefglatz/cropvariantsbuilder 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 24.46k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 9
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 1

GitHub 信息

  • Stars: 7
  • Watchers: 1
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2020-01-08