studiobonito / silverstripe-imagefunctions
3.3.2
2015-08-28 10:24 UTC
Requires
- php: >=5.3.2
- silverstripe/framework: 3.*
This package is not auto-updated.
Last update: 2022-02-01 12:23:46 UTC
README
此SilverStripe模块已过时,请考虑使用silverstripe-imageextension
模块。
图像功能模块
概述
图像功能模块主要向图像对象添加更多图像功能,同时也添加了一些有用的站点配置设置。
要求
SilverStripe 3.0或更高版本。
安装说明
将'imagefunctions'文件夹复制到您的SilverStripe安装根目录。
函数
RationCrop
RationCrop是一个图像函数,它先调整图像大小然后裁剪,我们认为这在处理用户上传的图像时能给出最佳结果。
使用概述
<% with Image %>
$RatioCrop(200,300)
<% end_with %>
占位符图像
此模块还提供了通过三个数据扩展(PlaceholderImagePageExtension、PlaceholderImagePerPageExtension、PlaceholderImageSiteConfigExtension)设置占位符图像的功能。
使用概述
$PlaceholderImage
PlaceholderImageSiteConfigExtension(必需)
这是主要扩展,它将占位符图像添加到站点配置。此扩展必须配置才能使用其他扩展。
PlaceholderImagePageExtension(必需)
此扩展添加了访问占位符图像的方法。默认情况下,此扩展被添加到页面数据对象。
PlaceholderImagePerPageExtension(可选)
此扩展将占位符图像添加到任何数据对象。它被设计成添加到作为其他数据对象父对象的数据对象,从而允许占位符图像的本地化继承。