定制 schnitzler/fluid-styled-responsive-images 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

schnitzler/fluid-styled-responsive-images

Composer 安装命令:

composer require schnitzler/fluid-styled-responsive-images

包简介

Enables creation of responsive images for fluid styled content elements.

README 文档

README

Build Status Codecov

Total Downloads Latest Stable Version Latest Unstable Version License

This project aims to provide an image-rendering process that will render responsive images with fluid, where the assumption is made, that TYPO3 CMS doesn't provide a mechanism out of the box for fluid templates while one is able to do it with TypoScript.

Installation

  • Install via composer using the current stable release and track new stable releases: composer require schnitzler/fluid-styled-responsive-images:"^10.2" and enable the extension through the extension manager / your preferred mechanism
  • Use the current development version by running composer require schnitzler/fluid-styled-responsive-images:"dev-master" in your composer.json file, run composer update
  • Clone the current development version to your typo3conf/ext directory (ex. cd typo3conf/ext && rm -Rf fluid_styled_responsive_images && git clone https://github.com/alexanderschnitzler/fluid-styled-responsive-images.git fluid_styled_responsive_images)

Configuration

The extension is configured through TypoScript, like most parts of your site are. Include the static TypoScript of the extension and then begin with the Configuration through your own TypoScript setup.

The ImageRenderer currently supports the [srcset](srcset specification) and rendering as data-attributes, which is to make custom rendering with javascript easier.

Minimal, empty configuration:

tt_content.textmedia.settings.responsive_image_rendering {
    layoutKey = srcset

    sourceCollection {
        # Please write your own sourceCollection configuration
    }
}

Mode srcset

A sourceCollection entry is a TypoScript hash. It can contain the following indices:

key description example
width The target size of the generated image. Supports modifications like m & c 1200c (crops the image to 1200px)
srcset a string describing the condition under which the image is displayed 1200w (1200px viewports)
dataKey a name for the generated data-attribute desktop
sizes [optional] a media query with custom styles to be applied (min-width: 1200px) 1170px

For more precise descriptions, please check out the html img element specification on srcset.

Configuration Example

tt_content.textmedia {
    settings {
        responsive_image_rendering {
            layoutKey = srcset

            sourceCollection {
                10 {
                    dataKey = desktop
                    width = 1260m
                    srcset = 1260w
                }

                20 {
                    dataKey = table
                    width = 960m
                    srcset = 960w
                }

                30 {
                    dataKey = tablet-small
                    width = 720m
                    srcset = 720w
                }

                40 {
                    dataKey = medium
                    width = 640m
                    srcset = 640w
                }

                50 {
                    dataKey = medium-phone
                    width = 360m
                    srcset = 360w
                }

                60 {
                    dataKey = small
                    width = 320m
                    srcset = 320w
                }
            }
        }
    }
}

Usage

After installation and configuration, the output of the <f:media> viewhelper uses the logic this extension supplies for images and renders the image.

Inner workings

  1. a custom image renderer is registered
  2. when the RendererRegistry is asked for a renderer suitable for the current mimetype, the renderer proposes itself if one of the known image mimetypes is matched
  3. the renderer reads the current TypoScript and merges it with global extension configuration like the enableSmallDefaultImage setting
  4. the renderer then calculates the needed sizes and returns a ready-made img-tag

Extending fluid_styled_responsive_images

Since fluid_styled_content is used, much of the output in TYPO3 CMS can be adjusted.

Example of registering custom templates and adjusting images in collaboration with the GalleryProcessor in fluid_styled_content to provide precise rendering with Bootstrap 3 based templates: websightgmbh/ws-texmedia-bootstrap.

License

GPL-2.0+

schnitzler/fluid-styled-responsive-images 适用场景与选型建议

schnitzler/fluid-styled-responsive-images 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 9.76k 次下载、GitHub Stars 达 27, 最近一次更新时间为 2016 年 01 月 30 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 schnitzler/fluid-styled-responsive-images 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

  • 总下载量: 9.76k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 27
  • 点击次数: 13
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 27
  • Watchers: 8
  • Forks: 16
  • 开发语言: PHP

其他信息

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