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
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 yourcomposer.jsonfile, runcomposer update - Clone the current development version to your
typo3conf/extdirectory (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
- a custom image renderer is registered
- when the
RendererRegistryis asked for a renderer suitable for the current mimetype, the renderer proposes itself if one of the known image mimetypes is matched - the renderer reads the current TypoScript and merges it with global extension
configuration like the
enableSmallDefaultImagesetting - 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 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 schnitzler/fluid-styled-responsive-images 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
A Laravel Nova field for distribute your images as array of object.
Pexels API Client for www.pexels.com
Set Links with a specific language parameter
ResponsiveImages Plugin for October CMS
TYPO3 CMS extension to create gallery content element with preset crop ratios and pagination
TYPO3 extension for sending responsive email templates
统计信息
- 总下载量: 9.76k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 27
- 点击次数: 13
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2016-01-30