定制 loqus/bynder-craft-cms 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

loqus/bynder-craft-cms

最新稳定版本:1.0.7

Composer 安装命令:

composer require loqus/bynder-craft-cms

包简介

Bynder DAM Integration for Craft CMS 5.x

README 文档

README

This unofficial plugin integrates Bynder Digital Asset Management with Craft CMS 5.x by exposing their UCV image selector as a popup that saves the selected image data in a field so the selection can be used in twig templates.

Screenshot

Installation

To install the plugin, follow these instructions.

  • Open your terminal and go to your Craft project:
cd /path/to/project
  • Then tell Composer to load the plugin:
composer require loqus/bynder-craft-cms
  • In the Control Panel, go to Settings → Plugins and click the “Install” button for 'craft-bynder-assets'.

OR do it via the command line

php craft install/plugin bynder-craft-cms
  • On the settings page, fill out the Bynder portal url without https:// to start using the plugin.

Requirements

2 new fields are required for the plugin to work. Add:

  • datLocation
  • mediaId

fields to the volume(s)

Fields

  • If the plugin is installed and the fields have been added you will see two new buttons. One in the asset overview for uploading multiple assets from your Bynder portal

Screenshot

  • And one in the asset detail overview to replace the current image

Screenshot

Important

When an asset has been chosen, the datLocation and mediaId have been filled and the asset has been saved. A 10% quality image will be saved in the original dimensions in the local folder in order for Craft to have a physical (but smaller) asset. If you remove the values from the datLocation and mediaId fields and save the asset a full size copy is stored locally as a backup.

Templating:

Plain and simple

  • The plugin was created as replacement for imager-x
{% set image = entry.headerImage.one() %}
{% set compressedImage = craft.imager.transformImage(image, {width: 1000,mode: 'crop', position: '50% 50%'}) %}
  • You can use the same attributes like this:
{% set image = entry.headerImage.one() %}
{% if(image.datLocation is defined and image.datLocation != "" %}
 {% set compressedImage = craft.bynder.transformImage(image, {width: 1000,mode: 'crop', position: '50% 50%'}) %}
{% else %}
 {% set compressedImage = craft.imager.transformImage(image, {width: 1000,mode: 'crop', position: '50% 50%'}) %}
{% endif %}
<img src="{{ compressedImage.url }}" width="{{compressedImage.width}}" height="{{compressedImage.height}}" alt="{{ compressedImage.title }}">

Available attributes

The mode accepts the most common used imager and bynder transforms: 'crop', 'fit', 'fill' and 'ratio'
Currently there is no support for complex transforms or srcsets

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-19