diatem-net / twig_imageformat
通过样式返回格式化的图片。
2.0.1
2023-10-13 15:13 UTC
This package is not auto-updated.
Last update: 2024-09-17 17:28:07 UTC
README
图片格式允许您根据后台定义的样式检索图片。
需求
Drupal 9.x。
安装
按常规安装此模块。请参阅 https://www.drupal.org/docs/extending-drupal/installing-modules
用法
参数: - 节点 ID 或术语 ID - 图片格式 - 如果有多个图片的图片键
{% set image = imageformat(node.id, 'field_image', 'style' , key) %} {% set image = termImageformat(term.id, 'field_image', 'style' , key) %}