level51/silverstripe-image-credits

为Silverstripe提供的图片版权扩展

安装: 12

依赖项: 0

建议者: 0

安全: 0

星标: 0

关注者: 1

分支: 0

开放问题: 0

类型:silverstripe-vendormodule

dev-develop 2024-07-01 00:00 UTC

This package is auto-updated.

Last update: 2024-09-09 18:54:01 UTC


README

为SilverStripe 5添加图片模型的版权模块。

开发/测试

在开发或设置测试期间,默认的缓存行为很麻烦,因此您可以使用以下自定义配置禁用它

---
Name: custom-image-credits
After: level51-image-credits
---
Level51\ImageCredits\ImageExtension:
  force_rebuild: true

图片版权页面

在所有模板中全局可用变量 $ImageWithCredits,可以用来渲染所有带有版权的图片列表。因此,您可以在任何模板中使用它,例如

<% loop $ImageWithCredits %>
    <div style="display: flex;">
        <div style="flex: none; margin-right: 2rem;">
            $ScaleWidth(200)
        </div>

        <div style="flex: auto;">
            $Credits
        </div>
    </div>
<% end_loop %>

需求

  • SilverStripe ^5.0
  • PHP >= 8.0

维护者