daun/statamic-original-filename
最新稳定版本:1.1.0
Composer 安装命令:
composer require daun/statamic-original-filename
包简介
Remember the original filenames of assets uploaded in Statamic
关键字:
README 文档
README
Remember the original, unsanitized filenames of assets uploaded in Statamic.
This addon stores the original filename of uploaded assets in their metadata, allowing later access even after Statamic has sanitized the filename for compatibility. Useful for allowing downloads with the original name or using it as a worst-case alt text for images.
- Filename as uploaded:
Fauvette à tête noire © Jean Dupont.jpg - Filename as sanitized:
fauvette-a-tete-noire-jean-dupont.jpg - Original filename:
Fauvette à tête noire © Jean Dupont
Installation
composer require daun/statamic-original-filename
Usage
Once installed, the addon will store the original filename of each uploaded asset in its
metadata under the key original_filename. The filename is saved without the file extension.
Frontend
To offer downloads using the original filename:
{{ asset }}
<a href="{{ url }}" download="{{ original_filename }}.{{ extension }}">
Download {{ original_filename }}
</a>
{{ /asset }}
To use the original filename as fallback alt text for images:
{{ asset }}
<img src="{{ url }}" alt="{{ alt ?? original_filename }}">
{{ /asset }}
Backend
If you want your editors to see (and possibly edit) the original filename in the control panel,
add a text field to your asset blueprint, using original_filename as the handle.
title: Asset
fields:
-
handle: alt
field:
type: text
display: Alt Text
+ -
+ handle: original_filename
+ field:
+ type: text
+ display: Original Filename
License
统计信息
- 总下载量: 49
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-16