purplespider/asset-alt-text

Adds an alternative text field to Image assets, so that you don't need to use the image 'Title' field.

Installs: 7 956

Dependents: 4

Suggesters: 0

Security: 0

Stars: 3

Watchers: 4

Forks: 2

Open Issues: 1

Type:silverstripe-vendormodule

1.2.1 2023-05-17 09:46 UTC

This package is auto-updated.

Last update: 2024-04-18 10:58:37 UTC


README

Adds an alternative text field to Image assets, so that you don't need to use the image Title field (which would typically be more succinct than useful alt text).

As a bonus feature, when adding an image to an HTMLEditorField, the alt text field gets pre-filled with any asset alt text.

Usage

Install via composer composer require purplespider/asset-alt-text

dev/build

Go to the Files and select an image to see the new field:

68747470733a2f2f702e737064722e6d652f466c353571482b

To make use of the alt text value in your templates, just use $AltText. e.g.:

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