purplespider/asset-alt-text

为图像资产添加替代文本字段,因此您不需要使用图像的 '标题' 字段。

安装次数: 10,293

依赖者: 4

建议者: 0

安全性: 0

星级: 4

关注者: 4

分支: 3

公开问题: 1

类型:silverstripe-vendormodule

2.0.0 2024-06-28 13:13 UTC

This package is auto-updated.

Last update: 2024-08-28 13:34:21 UTC


README

为图像资产添加替代文本字段,因此您不需要使用图像的 标题 字段(通常比有用的替代文本更简洁)。

作为额外功能,当将图像添加到 HTMLEditorField 时,替代文本字段会自动填充任何资产的替代文本。

使用方法

通过 composer 安装 composer require purplespider/asset-alt-text

dev/build

转到 文件 并选择一个图像以查看新字段

要在模板中使用替代文本值,只需使用 $AltText。例如。

<% with BannerImage %>
    <img src="$URL" width="$Width" height="$Height" alt="$AltText" />
<% end_with %>