thelia/thelia-library-module 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

thelia/thelia-library-module

Composer 安装命令:

composer require thelia/thelia-library-module

包简介

Add a media library to Thelia

README 文档

README

Add a media library on Thelia.

Composer

Add it in your main thelia composer.json file

composer require thelia/thelia-library-module:~1.0.0

Usage

For now this module doesn't have an interface, only an api documented on {your_website_url}/open_api/doc

Using Plugins

You can use the getImages and getImagesData plugins. Both of them are available with Smarty and Twig. Use this plugins instead the traditional loop (in case you have to deal with smarty).

  • getImagesData return an array of processed images, depends of your liip_imagine configuration.
  • getImages use the same service that getImagesData and render image(s) in a html tag

Here’s the params :

Param Required Description Exemple
img_id false if you have the id of the current image, you can use this param with source_type /
source_type true source content, product, category, library, page or folder
source_id false The identifier of the object provided in the "source" parameter /
filters true the liip_imagine filter’ identifier you want to use on the image could be a simple value like product_filter or a array, if you want to render several images in a picture html tag *filters=*['1440px' =>'hero_large_desktop', 'default' => 'hero_default'
img_attrs false / img_attrs=['width' => '768px','height' => '660px','class' => "test-class-img"]
alt false string to render as alt an title attribute. If you have a alt entry in your img_attrs this one will be overrided. /
wrapper false An html wrapper tag for the rendered image. If filters count > 1, image will be wrapped by a picture html tag.
wrapper_attrs false html attributes for wrapper wrapper_attrs=['class' => "test-class-picture"]
img_style false css propreties rended in the image style attribute img_style=['display' => 'block','margin' => '10px']
placeholder false fallback image to return. if no set, plugin will return null {encore_manifest_file *file=*"dist/images/placeholder.webp"}
position false position of the image 1
limit false limited number of result 1
offset false / 1
container An html wrapper tag for wrappe the list of rendered images / ul, div, section
container_attrs same as wrapper_attrs / container_attrs=['class' => "test-class-container"]

Here’s the exemple :

{getImages
  source_type="content"
  source_id=2
  filters=[
    '1440px' => 'hero_large_desktop',
    '1280px' => 'hero_small_desktop',
    '1024px' => 'hero_tablette',
    '768px' => 'hero_mobile',
    'default' => 'hero_default'
  ]
  img_attrs=[
    'width' => '768px',
    'height' => '660px',
    'class' => "test-class-img"
  ]
  wrapper="picture"
  wrapper_attrs=[
    'class' => "test-class-picture"
  ]
  img_style=[
    'display' => 'block'
  ]
  limit=1
  placeholder={encore_manifest_file file="dist/images/placeholder.webp"}
}

thelia/thelia-library-module 适用场景与选型建议

thelia/thelia-library-module 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16.37k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2021 年 05 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 thelia/thelia-library-module 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 thelia/thelia-library-module 我们能提供哪些服务?
定制开发 / 二次开发

基于 thelia/thelia-library-module 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 16.37k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 4
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 6
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2021-05-17